UNPKG

node-password-generator

Version:

A simple lightweight npm library for password generator. It allows you to create random unqiue password on the fly.

30 lines (29 loc) 820 B
import { WordOptions } from "./lib/word.options"; export default class WordsPasswordGenerator { readonly wordoptions: Partial<WordOptions>; /** * @constructor * @param {Object} [options] generator options. */ constructor(wordoptions: Partial<WordOptions>); /** * Function, which will generate the password based on provided options. * * @return {string} Genrated result. * * @example * * const options = { * uppercase: false, * lowercase: true, * numbers: true, * symbols: false, * length: 10 * }; * * const generator = new SimplePasswordGenerator(options); * * generator.generatePassword(); //=> mystrongpassword */ generatePassword(wordoptions?: Partial<WordOptions>): Promise<string>; }