NodeJS library for generating cryptographically-secure passwords.
Installations
npm install generate-password
Score
99.8
Supply Chain
87.6
Quality
76
Maintenance
100
Vulnerability
100
License
Developer
brendanashworth
Developer Guide
Module System
CommonJS, ESM
Min. Node Version
Typescript Support
Yes
Node Version
19.3.0
NPM Version
9.2.0
Statistics
357 Stars
62 Commits
67 Forks
8 Watching
3 Branches
14 Contributors
Updated on 17 Nov 2024
Bundle Size
2.04 kB
Minified
939.00 B
Minified + Gzipped
Languages
JavaScript (97.02%)
Shell (2.98%)
Total Downloads
Cumulative downloads
Total Downloads
55,322,025
Last day
-5.1%
66,315
Compared to previous day
Last week
-5.7%
348,194
Compared to previous week
Last month
9.1%
1,565,947
Compared to previous month
Last year
22.1%
16,012,333
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
7
Generate Password
Generate Password is a (relatively) extensive library for generating random and unique passwords.
Install
1$ npm install generate-password --save
Usage
generate([options])
Generate one password with the given options. Returns a string.
1var generator = require('generate-password'); 2 3var password = generator.generate({ 4 length: 10, 5 numbers: true 6}); 7 8// 'uEyMTw32v9' 9console.log(password);
generateMultiple(amount[, options])
Bulk generate multiple passwords at once, with the same options for all. Returns an array.
1var generator = require('generate-password'); 2 3var passwords = generator.generateMultiple(3, { 4 length: 10, 5 uppercase: false 6}); 7 8// [ 'hnwulsekqn', 'qlioullgew', 'kosxwabgjv' ] 9console.log(passwords);
Available options
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.
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.
Stable Version
The latest stable version of the package.
Stable Version
1.7.1
MODERATE
1
0/10
Summary
Cryptographically Weak PRNG in generate-password
Affected Versions
< 1.4.1
Patched Versions
1.4.1
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/brendanashworth/generate-password/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/brendanashworth/generate-password/nodejs.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
8 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-c5hm-xc74-pqrg
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Reason
Found 0/21 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Score
2.9
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More