flexible-password-generator
v1.0.3
Published
A password generator npm package.
Downloads
5
Maintainers
Readme
flexible-password-generator
A customizable password generator npm package that allows you to generate passwords with a flexible combination of uppercase letters, lowercase letters, digits, and special characters.
Installation
To install the package, use the following npm command:
npm install flexible-password-generator
Usage
You can use the generatePassword function to generate passwords with flexible criteria. The function takes the following parameters:
uppercaseCount
: Number of uppercase letters in the password.lowercaseCount
: Number of lowercase letters in the password.numbersCount
: Number of digits in the password.specialCharactersCount
: Number of special characters in the password.shouldShuffle
: (Optional) Set to true if you want to shuffle the characters in the generated password.
You can also specify the exact length of each character type you want to include. For example, if you want to exclude special characters, you can pass 0
for specialCharactersCount
.
Here's an example of how to use the function:
const flexiblePasswordGenerator = require('flexible-password-generator');
const uppercaseCount = 2;
const lowercaseCount = 2;
const numbersCount = 2;
const specialCharactersCount = 2;
const shouldShuffle = true;
const password = flexiblePasswordGenerator.generatePassword(
uppercaseCount,
lowercaseCount,
numbersCount,
specialCharactersCount,
shouldShuffle
);
By default, the shouldShuffle parameter is set to false.