passwagen.js
Password generator with multiple options
⚙️ Installation
npm i passwagen
📖 Usage
▣ Import
import passwagen from "passwagen";
const passwagen = require("passwagen");
▣ Generate
const password = passwagen();
console.log(password);
▣ Generate with options for characters
const password = passwagen({
numbers: true,
uppercase: true,
lowercase: true,
symbols: true,
punctuation: true,
characters: "abc"
});
console.log(password);
▣ Generate with options for length and amount
const password = passwagen({
length: 10,
amount: 20
});
console.log(password);
If the amount is one (by default) then it will return a string otherwise it will return an array of strings.
▣ Generate with strict mode
const password = passwagen({
strict: true
});
console.log(password);
strict mode will make sure that the password uses atleast one character from each field (numbers, lowercase, etc.)
But for example, if punctuation is set to false (by default) strict mode won't make the password include punctuation.
▣ Generate with custom character set
const password = passwagen({
characters: "abc",
custom: true
});
console.log(password);
Setting custom to true will make it use only the characters that you provide.
Support me on Patreon -
Check out my socials