This is a cli wrapper for generate-password and bcryptjs to generate and hash password from command line.
Password generated will be like GFZmGFWBVJ
.
npm install -g pwd-cli
password # this will generate a password for you.
GFZmGFWBVJ # output password
password --numbers -l 20 # The password contains numbers and length will be 20
options { numbers: true, length: 20 } # output options
l9y6eds7u8Q8wDKbIVuZ # output password
Please refer options to https://www.npmjs.com/package/generate-password#available-options
const optionDefinitions = [
{name: 'length', alias: 'l', type: Number},
{name: 'numbers', alias: 'n', type: Boolean},
{name: 'symbols', alias: 's', type: Boolean},
{name: 'lowercase', type: Boolean},
{name: 'uppercase', type: Boolean},
{name: 'excludeSimilarCharacters', type: Boolean},
{name: 'exclude', type: String},
{name: 'strict', type: Boolean},
{name: 'hash', type: Boolean}, // show hash result by bcrypt as well.
{name: 'help', alias: 'h', type: Boolean}, // will show option definitions and not generate password.
]
hash-pwd <YOUR_PASSWORD>
hash-pwd super_secret
$2a$10$jKwDbN2d4aLmC7tiaoqoXeTpExgCd2LBGnVc.oQTZhTG6I7sh4hYm
clone this repository and run npm link
.