generate-random-secure-password
v1.2.0
Published
Generate Random Secure Password is a library that will generate a password according to user's given options
Downloads
3
Maintainers
Readme
Generate Random Secure Password
Generate Random Secure Password is a library that generates secure passwords according to user's given options.
Installation
To install this library, you can use npm or yarn:
npm install generate-random-secure-password
or
yarn add generate-random-secure-password
Usage
After installing the library, you can import it into your project as follows:
const passwordGenerator = require('generate-random-secure-password');
Once imported, you can use the passwordGenerator
object to generate secure passwords with the following function:
passwordGenerator.generate(options);
The options
parameter is an object that contains the following properties:
length
: the length of the password (default is8
)numbers
: whether to include numbers in the password (default isfalse
)symbols
: whether to include symbols in the password (default isfalse
)lowercase
: whether to include lowercase letters in the password (default istrue
)uppercase
: whether to include uppercase letters in the password (default istrue
)excludeSimilarCharacters
: wheter to exclude similar characters in the password (default isfalse
)
Here is an example usage:
const passwordGenerator = require('generate-random-secure-password');
const options = {
length: 16,
numbers: true,
symbols: true,
uppercase: true,
lowercase: true
};
const password = passwordGenerator.generate(options);
console.log(password); // Example output: "iL9%Zp6#G4@oE2vJ"
Development
If you want to develop or contribute to this project, you can clone the repository and run the following commands:
npm install # or yarn install
npm run build # or yarn build
npm run test # or yarn test
This will install the necessary dependencies, build the project, and run the tests.
License
This library is licensed under the MIT license. See LICENSE for more information.