random-pass-generator
v1.4.0
Published
Random Password Generator
Downloads
2
Readme
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@-' ]