random-pass-generator

1.4.0 • Public • Published

random-pwd-generator

random-pwd-generator is a Node.js package for generating random passwords. It can be used in command-line applications, web applications, and any other JavaScript projects.

Installation

To install the package, use the following command: npm install random-pwd-generator

Usage

To use the package, require it in your JavaScript file: import { generatePassword, generateMultiplePasswords } from 'random-pwd-generator'

generatePassword(length, options = {})

This function generates a random password of the specified length. It takes two arguments:

length: Required. The length of the password to generate. options: Optional. An object with the following properties: exclude: A string of characters to exclude from the generated password.

Example:

const password = generatePassword(10, { exclude: 'abc123' });
console.log(password); // Output: e@Yb%r7|1

generateMultiplePasswords(numPasswords, length, options = {})

This function generates an array of random passwords. It takes three arguments:

numPasswords: Required. The number of passwords to generate. length: Required. The length of each password to generate. options: Optional. An object with the following properties: exclude: A string of characters to exclude from the generated passwords.

Example:

const passwords = generateMultiplePasswords(3, 10, { exclude: 'abc123' });
console.log(passwords); // Output: [ 'e@Yb%r7|1', 'f|)Ht^z6$', 'x&Xs}D5@-' ]

Readme

Keywords

Package Sidebar

Install

npm i random-pass-generator

Weekly Downloads

1

Version

1.4.0

License

ISC

Unpacked Size

2.64 kB

Total Files

3

Last publish

Collaborators

  • fardakarimov