A password generator compiled as Wasm for use on the CLI, in a custom element, or as a module.
npx pwgen -sy 20 1
npm i -g pwgen
pwgen -sy 20 1
wapm install kherrick/pwgen
wapm run pwgen -sy 20 1
<x-pwgen></x-pwgen>
<script type="module">
import 'https://unpkg.com/pwgen'
</script>
<x-pwgen composed flags="-sy" length="20" number="1"></x-pwgen>
<script type="module">
import 'https://unpkg.com/pwgen'
document.addEventListener(
'x-pwgen-handle-password',
({ detail }) => {
console.log(detail.msg)
}
)
</script>
npm i pwgen
import React from 'react';
import 'pwgen';
const App: React.FC = () => {
return (
<x-pwgen></x-pwgen>
)
}
const pwgen = require('pwgen')
const flags = '-1sy'
const length = '20'
const number = '10'
pwgen({
arguments: [ flags, length, number ],
print: stdout => {
console.log(`Password: ${stdout}`)
}
})
git clone https://github.com/kherrick/pwgen && \
cd pwgen && \
git submodule update --init --recursive
npm start
npm run build