1.0.3 • Published 9 months ago

flexible-password-generator v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

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.