A password generator compiled as Wasm for use on the CLI, in a custom element, or as a module.
npx pwgen -sy 20 1npm i -g pwgenpwgen -sy 20 1wapm install kherrick/pwgen
wapm run pwgen -sy 20 1With default options (demo)
<x-pwgen></x-pwgen>
<script type="module">
import 'https://unpkg.com/pwgen'
</script>With additional options and detail logging (demo)
<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 pwgenimport 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}`)
}})Download pwgen.wbn
git clone https://github.com/kherrick/pwgen && \
cd pwgen && \
git submodule update --init --recursivenpm startnpm run build:node && \
npm run build:browser