passgeneratorlib v1.2.2
PassGeneratorLib
PassGeneratorLib is a NodeJS project that allows you to generate all sort of password.
Examples
Simple use.
In this context, we disable numbers, lowercase letters and set the length to 32 characters.
const PassGeneratorLib = require('passgeneratorlib')
const PassGenerator = new PassGeneratorLib()
.setLength(32)
.setLowerCase(false)
.setNumeric(false)
.build()
console.log('password:', PassGenerator)
Use with multiple passwords and exclusion of characters.
In this context, we do the same that before but we set the number of output passwords to 10 and we exclude the following characters: A, B, C, D, E, F
const PassGeneratorLib = require('passgeneratorlib')
const password = new PassGeneratorLib({
multiplePasswords: 10,
exclude: 'ABCDEF'
})
.setLength(32)
.setLowerCase(false)
.setNumeric(false)
.build()
console.log('password:', password)
Use with regex exclusion. In this context, we do the same as before but we set the exclude to a regex in order to remove uppercase letters from A to H.
const PassGeneratorLib = require('passgeneratorlib')
const password = new PassGeneratorLib({
multiplePasswords: 10,
exclude: /([A-H])/g
})
.setLength(32)
.setLowerCase(false)
.setNumeric(false)
.build()
console.log('password:', password)
Available options
These options allow you to manipulate the number of generated passwords and the characters to be excluded.
- multiplePasswords : Integer
- exclude : String / Regex
Available functions
These functions allow you to manipulate how the password will be generated.
Name | Value Type | Default value |
---|---|---|
setNumeric | Boolean | True |
setLength | Integer | 12 |
setSpecialCharacters | Boolean | True |
setUpperCase | Boolean | True |
setLowerCase | Boolean | True |
setBase | String / Regex | Empty string |
License
This project is licensed under the MIT License - see the LICENSE file for details.