nodepassjs
v1.0.10
Published
A simple and lightweight password generator for Node.js, usable as a library and CLI.
Downloads
33
Maintainers
Readme
nodepassjs 🔐
A simple and lightweight password generator for Node.js.
📦 Installation
Install with npm:
npm install nodepassjsHow To Use
Use the generatePass() function to create a password.
import generatePass from "nodepassjs";
const password = generatePass(12, true, true);
console.log(password);The generatePass function accepts three parameters:
generatePass(length = 8, withDigits = true, withSpecial = true)
length (number) — password length (default: 8)
withDigits (boolean) — include numbers 0-9 (default: true)
withSpecial (boolean) — include special characters like !@#$% (default: true)
CLI Usage
After installing globally with -g, you can generate passwords directly from your terminal:
# Generate a default password (8 chars, with digits and special characters)
passjs
# Generate a 12-character password with digits and special characters
passjs 12
# Generate a 10-character password with letters only
passjs 10 false false
# Generate a 16-character password with letters and digits only
passjs 16 true false