A simple and customizable NPM package for generating random passwords based on specified criteria. Choose from uppercase letters, lowercase letters, numbers, and special characters to create secure, unique passwords.
Install the package using NPM:
npm install random-password-generator-future-generationconst generatePasswords = require('random-password-generator-future-generation');generatePasswords(pattern, size, quantity);- pattern: A string specifying the character types to include:
Afor uppercase letters (A-Z)afor lowercase letters (a-z)1for numbers (0-9)@for special characters (!@#$%^&*()_+~|}{[]:;?><,./-=`)
- size: Length of each password.
- quantity: Number of passwords to generate.
const generatePasswords = require('random-password-generator-future-generation'); const pattern = 'Aa1@'; // Includes uppercase, lowercase, numbers, and special characters const size = 12; // Password length const quantity = 5; // Number of passwords to generate const { passwords } = generatePasswords(pattern, size, quantity); console.log(passwords); // Array of 5 randomly generated passwords, each 12 characters longRun the package directly from the command line:
node index.js <pattern> <size> <quantity>Example:
node index.js Aa1@ 10 3This command will generate 3 passwords, each 10 characters long, containing uppercase letters, lowercase letters, numbers, and special characters.
A: Uppercase letters (A-Z)a: Lowercase letters (a-z)1: Numbers (0-9)@: Special characters (!@#$%^&*()_+~`|}{[]:;?><,./-=)
The function returns an object with a passwords key containing an array of generated passwords:
{ "passwords": ["examplePassword1", "examplePassword2", "examplePassword3"] }- start: Runs the CLI tool to generate passwords.
- test: Placeholder script.
This project is licensed under the ISC License.
Developed by themrsami