1.0.6 • Published 8 years ago
strong-password-generator v1.0.6
strong-password-generator
Strong Password Generator is a utility module which provides straight-forward, powerful password generation function.
Installation
To install strong-password-generator, use npm:
npm install strong-password-generatorUsage
using default configurations
var strongPaswordGenerator = require("strong-password-generator");
strongPaswordGenerator.generatePassword();
// >> "cWst77snJtVris"providing own configurations
var strongPaswordGenerator = require("strong-password-generator");
var defaultPasswordConfig = {
base: 'WORD',
length: {
min: 12,
max: 16
},
capsLetters: {
min: 3,
max: 3
},
numerals: {
min: 2,
max: 2
},
spacialCharactors: {
includes: [],
min: 0,
max: 0
},
spaces: {
allow: false,
min: 0,
max: 0
}
};
strongPaswordGenerator.generatePassword(defaultPasswordConfig); // defaultPasswordConfig optional
// >> "cWst77snJtVris"get default configurations
var strongPaswordGenerator = require("strong-password-generator");
strongPaswordGenerator.getDefaultConfig();
// >> {
base: 'WORD',
length: {
min: 12,
max: 16
},
capsLetters: {
min: 3,
max: 3
},
numerals: {
min: 2,
max: 2
},
spacialCharactors: {
includes: [],
min: 0,
max: 0
},
spaces: {
allow: false,
min: 0,
max: 0
}
}API
strong-password-generator.
generatePassword(options)- options OPTIONALbase- describe the way that password text populated REQUIREDWORD- from random word for given lengthRANDOM- from a totaly random text for given length
length- length of the password REQUIREDmin- minimum length of the passwordmax- maximum length of the password
capsLetters- number of capital letters needs to be included within the password REQUIREDmin- minimum number of captital letters for the passwordmax- maximum number of captital letters for the password
numerals- number of numerals needs to be included within the password REQUIREDmin- minimum number of numerals for the passwordmax- maximum number of numerals for the password
spacialCharactors- details of the speacial charactors needs to be included within the password REQUIREDincludes- list of special charactors used to generate passwordmin- minimum number of special charactors for the passwordmax- maximum number of special charactors for the password
spaces- details of the spaces needs to be included within the password REQUIREDallow- specify whether password includes spaces or notmin- minimum number of spaces for the passwordmax- maximum number of spaces for the password
getDefaultConfig()- to get default configurations