Skip to content

pettermachado/node-password

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-password

Generate strong passwords

Installation

$ npm install node-password

Usage

var Password = require('node-password').Password;
var pw = new Password();
// pw.toString() => 'aJi*2&4nLk_0l!k'

Options

You can pass a configuration option to the Password() contstuctor.

var Password = require('node-password').Password;
var options = {
  length: 5,
  letters: true,
  numbers: false,
  special: false
};
var pw = new Password(options);

regererate()

Generates a new password.

var Password = require('node-password').Password;
var pw = new Password();
// pw.toString() => 'aJi*2&4nLk_0l!k'
pw.regenerate();
// pw.toString() => 'laOjNWjA7^24$@1'

toSafeString(s)

Return an obfuscated string of s or *.

var Password = require('node-password').Password;
var pw = new Password();
// pw.toSafeString() => '***************'

About

Generate strong passwords

Resources

License

Stars

Watchers

Forks

Packages

No packages published