Password Generator
A random password generator for node and browsers, which makes it possible to choose random-function. It either creates passwords using combinations of characters, digits and symbols, or from words (english or spanish currently).
Installation
npm install password-generator-js
Usage
Node.js
const PasswordGenerator = let password = PasswordGenerator
Browser
let password = PasswordGenerator
API
Synchronous
password = PasswordGenerator
It is possible to specifiy random function. The function should take no arguments and return a value between 0 and 1.
Asynchronous
password = PasswordGenerator password = PasswordGenerator password = PasswordGenerator
The random function should take a callback as argument and call it with the result or take no argument and return a promise which resolves with the result.
Options
length: 25 uppercase: true lowercase: true digits: true symbols: true obscureSymbols: true extra: ''
Extra symbols can be used to add possible characters to the algorithm.
Static
password = PasswordGeneratorpassword = PasswordGenerator
Object oriented
let passwordGenerator = options randomFunction passwordGeneratoroptions = ... passwordGenerator { ... } password = passwordGeneratorpassword = passwordGenerator
Words
Both english and spanish is currently available
Node.js
password = PasswordGenerator
Language is specified as a string such as 'english' or 'spanish'.
Browser
password = PasswordGenerator
Language is specified as a string such as 'english' or 'spanish'.