1.2.2 • Published 4 years ago

passgeneratorlib v1.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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.

NameValue TypeDefault value
setNumericBooleanTrue
setLengthInteger12
setSpecialCharactersBooleanTrue
setUpperCaseBooleanTrue
setLowerCaseBooleanTrue
setBaseString / RegexEmpty string

License

This project is licensed under the MIT License - see the LICENSE file for details.