Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
generate-password
Advanced tools
Readme
Generate Password is a (relatively) extensive library for generating random and unique passwords.
$ npm install generate-password --save
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);
Any of these can be passed into the options object for each function.
Name | Description | Default Value |
---|---|---|
length | Integer, 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 password | true |
uppercase* | Boolean, use uppercase letters in password. | true |
excludeSimilarCharacters | Boolean, exclude similar chars, like 'i' and 'l'. | false |
exclude | String, characters to be excluded from password. | '' |
strict | Boolean, password must include at least one character from each pool. | false |
*At least one should be true.
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.
FAQs
Easy library for generating unique passwords.
The npm package generate-password receives a total of 183,140 weekly downloads. As such, generate-password popularity was classified as popular.
We found that generate-password demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.