1.7.1 • Published 6 months ago

generate-password v1.7.1

Weekly downloads
120,565
License
MIT
Repository
github
Last release
6 months ago

Generate Password Build Status codecov

Generate-Password NPM

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

Install

$ npm install generate-password --save

Usage

generate([options])

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

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

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

// 'uEyMTw32v9'
console.log(password);

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' ]
console.log(passwords);

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 or String, 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.

Using this with a browser

As browsers don't have the "require" method that Node.js does, this module doesn't work in web environments. Instead generate-password-browser can be used.

@klicker-uzh/graphqlrentalainen-api@qlippoth/core@lrfmedia/lrfmedia_clistretchshop-base@compassdigital/provider.user.cdlfcenail-serveramag-drm-apiprebid-adpod-clientfmd-clicloud-stackvuechatboxwidgetndr-designsystemavrorajsatlas-metrics-servicelisa-clideploy-service@echidna/uibgc-ssm-securestring-plugin@myno_21/password-generator@lcnc/node@shaarit/truuth-aws-lib@codingbear03/strapi-plugin-keycloakpass-lockerupsurance-apigenerator-mcs@everything-registry/sub-chunk-1731@apeiromont/opshop-server@ihelpee/travelr-domain@igames/ghost-cli@ibmgaragecloud/cloud-native-toolkit-web-cli@ibm_wse/txrouter@hosoft/restful-api-framework@incremental.design/box-base@infinitebrahmanuniverse/nolb-generate@interval/server@maxijonson/phishermandevker@nir.simionovich/cloudonix-cli@latis/latis-cli@joowon-blinkly/zonemtawildduck@friendsthatcode/juicebox-clidiscord-veri@loftysoul/soul-clideploy-handlerdev-wdev-nodered-wadmin@metahkg/server@grucloud/core@moeec-js/xjai-common@mtntop/utilsnemjsunipol-hr-backendhematology_clientgenerator-saphanaacademy-faasgenerator-saphanaacademy-haagenerator-saphanaacademy-odatagenerator-saphanaacademy-saastapnow-nestjs-commontechfi-cliuni-order-nouask-appvendease-commonvibrant-device-serviceuser-auth-microserviceuser-login-modulezmok-apollozmok-serverwpenvboxzen-nestvuex-projectvulcanjswildduckyoss-apiyoltoolsynu-libsleg-tools@uniplanet-lib/common@tria-sdk/web@triggerfishab/lisa-cli@ubidy_devs/ubidy@plumes/sugar-common@provisioner/appengine@provisioner/appengine-contracts@provisioner/common@provisioner/helmengine@prisma-cms/user-module@tapnow/nestjs-commonmasson@telios/telios-client-backend@startupquickstart/servernensnepkit-connectoreasy-wormhole@revodigital/suiteods-admin-cli@rexfng/tfa@rexfng/auth@revved/lib-secret-manager@rs-pk/strapi-plugin-ssokamidpavil-password-utilskap-nextcloud
1.7.1

6 months ago

1.7.0

2 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

6 years ago

1.3.0

7 years ago

1.2.0

8 years ago

1.1.1

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago