Skip to content

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.

Notifications You must be signed in to change notification settings

themrsami/npm-random-password-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Password Generator - Future Generation

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.

Installation

Install the package using NPM:

npm install random-password-generator-future-generation

Usage

Importing the Package

const generatePasswords = require('random-password-generator-future-generation');

Function Syntax

generatePasswords(pattern, size, quantity);
  • pattern: A string specifying the character types to include:
    • A for uppercase letters (A-Z)
    • a for lowercase letters (a-z)
    • 1 for numbers (0-9)
    • @ for special characters (!@#$%^&*()_+~|}{[]:;?><,./-=`)
  • size: Length of each password.
  • quantity: Number of passwords to generate.

Example

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 long

CLI Usage

Run the package directly from the command line:

node index.js <pattern> <size> <quantity>

Example:

node index.js Aa1@ 10 3

This command will generate 3 passwords, each 10 characters long, containing uppercase letters, lowercase letters, numbers, and special characters.

Character Pattern Options

  • A: Uppercase letters (A-Z)
  • a: Lowercase letters (a-z)
  • 1: Numbers (0-9)
  • @: Special characters (!@#$%^&*()_+~`|}{[]:;?><,./-=)

Return Format

The function returns an object with a passwords key containing an array of generated passwords:

{
  "passwords": ["examplePassword1", "examplePassword2", "examplePassword3"]
}

Scripts

  • start: Runs the CLI tool to generate passwords.
  • test: Placeholder script.

License

This project is licensed under the ISC License.

Author

Developed by themrsami

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published