Easy library for generating unique passwords.

Generate Password

Generate Password is a (relatively) extensive library for generating random and unique passwords.


$ npm install generate-password --save



Generate one password with the given options. Returns a string.

var generator = require('generate-password');

var password = generator.generate({
    length: 10,
    numbers: true

// 'uEyMTw32v9'

generateMultiple(amount[, options])

Bulk generate multiple passwords at once, with the same options for all. Returns an array.

var generator = require('generate-password');

var passwords = generator.generateMultiple(3, {
    length: 10,
    uppercase: false

// [ 'hnwulsekqn', 'qlioullgew', 'kosxwabgjv' ]

Available options

Any of these can be passed into the options object for each function.

NameDescriptionDefault Value
lengthInteger, length of password.10
numbers*Boolean, put numbers in password.false
symbols*Boolean, put symbols in password.false
lowercase*Boolean, put lowercase in passwordtrue
uppercase*Boolean, use uppercase letters in password.true
excludeSimilarCharactersBoolean, exclude similar chars, like 'i' and 'l'.false
excludeString, characters to be excluded from password.''
strictBoolean, password must include at least one character from each pool.false

*At least one should be true.



下一篇:Vue打包优化之code spliting-02


  • videojs-generate-postcss-config

    Generate a standard postcss config, so that plugins don't need the same script in every repository. ...

    8 天前
  • videojs-generate-karma-config

    Generate a standard karma config, so that plugins don't need the same script in every repository. ...

    4 个月前
  • verb-generate-readme

    Generate your project's readme with verb. Requires verb v0.9.0 or higher. verbgeneratereadme NPM v...

    2 年前
  • unist-util-generated

    Check if a Unist node is generated unistutilgenerated Buildbuildbadgebuild Coveragecoveragebadgec...

    2 年前
  • township-reset-password-token

    Manage JWT tokens for resetting passwords townshipresetpasswordtoken Manage tokens for resetting ...

    4 个月前
  • the-password

    Password util for theframework thepassword ========== Build Statusbdtravisshieldurlbdtravisur...

    2 个月前
  • sails-generate

    Runner script for sails generators sailsgenerate Master of ceremonies for generators in the Sails...

    9 个月前
  • rgba-generate

    generate a color rgbagenerate ============= HomePage

    2 个月前
  • regenerate-unicode-properties

    Regenerate sets for Unicode properties and values. regenerateunicodeproperties Build status(https:...

    2 年前
  • regenerate

    Generate JavaScriptcompatible regular expressions based on a given set of Unicode symbols or code po...

    4 个月前


扫码加入 JavaScript 社区