@phidvss55/password-generate
v1.1.5
Published
A simple, powerful, and customizable command-line interface (CLI) tool for generating secure passwords. Built with Node.js.
Downloads
684
Readme
Password Generator CLI
A simple, powerful, and customizable command-line interface (CLI) tool for generating secure passwords. Built with Node.js.
Features
- Customizable Length: specific the length of password you want to generate.
- Numbers & Symbols: option to include or exclude numbers and symbols.
- Save to File: automatically append generated passwords to a
password.txtfile. - Clipboard Support: generated password is automatically copied to your clipboard.
Installation
Ensure you have Node.js installed. Then, install the package globally:
#u sing npm:
npm install @phidvss55/password-generate
# using pnpm
pnpm add @phidvss55/password-generate
# using yarn
yarn add @phidvss55/password-generateUsage
Run the tool from your terminal:
password-generate [options]Options
| Option | Alias | Description | Default |
| :--- | :--- | :--- | :--- |
| --length <number> | -l | Length of the password | 8 |
| --save | -s | Save password to password.txt | false |
| --no-numbers | -nn | Remove numbers from password | false |
| --no-symbols | -ns | Remove symbols from password | false |
| --version | -V | Output the version number | |
| --help | -h | Display help for command | |
Examples
Generate a default 8-character password:
password-generateGenerate a 20-character password:
password-generate -l 20Generate a password with no symbols and save it to file:
password-generate -ns --saveGenerate a 10-character password with letters only (no numbers, no symbols):
password-generate -l 10 -nn -nsProgrammatic Usage
You can also use this package in your own Node.js projects.
const createPassword = require('@phidvss55/password-generate');
// Generate a default 8-character password with numbers and symbols
const password = createPassword();
console.log(password); // e.g., "aB3$eR9@"
// Generate a customized password
// createPassword(length, hasNumbers, hasSymbols)
const customPassword = createPassword(20, false, false);
console.log(customPassword); // e.g., "abcdefGHIJKLmnOPqrst"