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) 779 B
import { Options } from "./lib/options"; export default class SimplePasswordGenerator { readonly options: Partial<Options>; /** * @constructor * @param {Object} [options] generator options. */ constructor(options: Partial<Options>); /** * 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(options?: Partial<Options>): string; }