password-ninja
v1.0.3
Published
password-ninja is designed to quickly generate passwords
Downloads
16
Maintainers
Readme
password-ninja
password-ninja is designed to quickly generate passwords
Installation
Using npm:
$ npm install --save password-ninja
Usage
var generatePassword = require('password-ninja');
API
generatePassword(length, options);
length
{Number}: (optional) The parameter that takes the length of the passwordoptions
{Object}: (optional) Optional parameters
length
the length of the string to generate
The default value is "8"
generatePassword(12)
will generate something like this02amNJa49oqC
generatePassword(32)
will generate something like thisIEa5V8X2S27pLIwAKF6KiH41kCm089Qw
options
the object that gets parameters
minAmountOfLowerChars
parameter that is responsible for the minimum number of lower characters
The default value is "1"
generatePassword(12, {minAmountOfLowerChars: 8})
will generate something like thisYcxyC2Tnwtmd
generatePassword(12, {minAmountOfLowerChars: 0})
will generate something like thisZXY05Q9654SU
generatePassword(12, {minAmountOfLowerChars: 1})
will generate something like thisK3sHYJNp836N
minAmountOfUpperChars
parameter that is responsible for the minimum number of upper characters
The default value is "1"
generatePassword(12, {minAmountOfUpperChars: 8})
will generate something like thisSLHA0BHTyF6a
generatePassword(12, {minAmountOfUpperChars: 0})
will generate something like this58m634m3qys9
generatePassword(12, {minAmountOfUpperChars: 1})
will generate something like this1rg5I5A0u2Xc
minAmountOfNums
parameter that is responsible for the minimum number of numbers
The default value is "1"
generatePassword(12, {minAmountOfNums: 8})
will generate something like this98107V706Rr8
generatePassword(12, {minAmountOfNums: 0})
will generate something like thisWqlKlwfEOvHB
generatePassword(12, {minAmountOfNums: 1})
will generate something like this88eupL0KpLWD
minAmountOfSymbs
parameter that is responsible for the minimum number of symbols
The default value is "0"
generatePassword(12, {minAmountOfSymbs: 8})
will generate something like this);3'@wW>?'.2
generatePassword(12, {minAmountOfSymbs: 0})
will generate something like this70T0d5Tp6vjV
generatePassword(12, {minAmountOfSymbs: 1})
will generate something like thisdBI55':Kt17>
toLowerCase
parameter that is used to switch characters to lower case
The default value is "false"
generatePassword(12, {toLowerCase: true})
will generate something like thise1kgpsk2vqrc
generatePassword(12, {toLowerCase: false})
will generate something like this2Dp37GXW4rdF
toUpperCase
parameter that is used to switch characters to upper case
The default value is "false"
generatePassword(12, {toUpperCase: true})
will generate something like thisT4284NI6NE4Z
generatePassword(12, {toUpperCase: false})
will generate something like this6Oa7tS9v5Ei0
Usage Examples
generatePassword(6, {minAmountOfNums: 0, toUpperCase: true})
will generate something like thisEHSCQI
generatePassword(20, {minAmountOfLowerChars: 10, minAmountOfUpperChars: 10, minAmountOfNums: 0})
will generate something like thisnQJCYbnYbzqVuvDIqcCE
generatePassword(12, {minAmountOfSymbs: 1, toLowerCase: true})
will generate something like thisd6=#0'89uf,e
License
Copyright © 2018, Dmitry Katyushin. Released under the MIT License.