@stopfnerf23072/node-pwm-gen
v1.1.0
Published
A Node.js command line tool and module for generating random passwords.
Readme
Node-pwm-gen
A Node.js command line tool and module for generating random passwords.
This project uses the commander npm package to process command line parameters for password settings such as length and special characters.
Installation
Install the required dependencies using npm:
npm install
Usage
You can run the script directly from the terminal with various options.
Default Call (8 characters, no special characters)
node index.jsCustom Password Length
node index.js --length 16
# or
node index.js -l 16Enable Special Characters
node index.js --special
# or
node index.js -sCombined Options
node index.js --length 12 --specialAvailable Options
| Option | Short | Description | Default |
| --- | --- | --- | --- |
| --length <number> | -l | Sets the length of the generated password | 8 |
| --special | -s | Includes special characters (!@#$%&*+-=?_~) | false |
| --help | -h | Displays all available commands | - |
Usage as a Module
You can also import the generator function into another project:
const generatePassword = require('node-pwm-gen');
// Generates a password with length 12 including special characters
const myPassword = generatePassword(12, true);
console.log(myPassword);