generate-pw 1.5.11 → 1.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -33
- package/dist/cli.min.js +13 -12
- package/dist/generate-pw.min.js +2 -2
- package/docs/LICENSE.md +3 -3
- package/docs/README.md +40 -33
- package/docs/SECURITY.md +3 -5
- package/package.json +22 -12
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="right">
|
|
2
2
|
<h6>
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://
|
|
5
|
-
<img height=14 src="https://
|
|
4
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/earth/white/icon32.svg?v=7c33be0">
|
|
5
|
+
<img height=14 src="https://assets.js-utils.org/images/icons/earth/black/icon32.svg?v=7c33be0">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-cn#readme">简体中文</a> |
|
|
@@ -19,17 +19,24 @@
|
|
|
19
19
|
|
|
20
20
|
### Randomly generate, strengthen, and validate cryptographically-secure passwords.
|
|
21
21
|
|
|
22
|
-
<a href="https://www.npmjs.com/package/generate-pw"
|
|
23
|
-
<
|
|
24
|
-
<a href="
|
|
25
|
-
<
|
|
26
|
-
<a href="https://github.com/adamlui/js-utils/
|
|
27
|
-
<
|
|
28
|
-
<a href="https://
|
|
22
|
+
<a href="https://www.npmjs.com/package/generate-pw">
|
|
23
|
+
<img height=31 src="https://img.shields.io/npm/dm/generate-pw?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
24
|
+
<a href="#%EF%B8%8F-mit-license">
|
|
25
|
+
<img height=31 src="https://img.shields.io/badge/License-MIT-fc4f2d.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
26
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/generate-pw-1.5.13">
|
|
27
|
+
<img height=31 src="https://img.shields.io/badge/Latest_Build-1.5.13-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
28
|
+
<a href="https://www.npmjs.com/package/generate-pw?activeTab=code">
|
|
29
|
+
<img height=31 src="https://img.shields.io/npm/unpacked-size/generate-pw?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
|
|
30
|
+
<a href="https://github.com/adamlui/js-utils/blob/generate-pw-1.5.13/generate-pw/dist/generate-pw.min.js">
|
|
31
|
+
<img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/generate-pw/dist/generate-pw.min.js?branch=generate-pw-1.5.13&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
|
|
32
|
+
<a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-pw/src/generate-pw.js">
|
|
33
|
+
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Agenerate-pw%2Fsrc%2Fgenerate-pw.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
|
|
34
|
+
<a href="https://github.com/toolleeo/cli-apps#password-managers">
|
|
35
|
+
<img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
29
36
|
|
|
30
37
|
<br>
|
|
31
38
|
|
|
32
|
-
<img height=6px width="100%" src="https://
|
|
39
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
33
40
|
|
|
34
41
|
## 💡 About
|
|
35
42
|
|
|
@@ -40,7 +47,7 @@
|
|
|
40
47
|
- **Multi-environment support —** Use in Node.js or the web browser
|
|
41
48
|
- **Command line usable —** Just type `generate-pw`, that's it
|
|
42
49
|
|
|
43
|
-
<img height=6px width="100%" src="https://
|
|
50
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
44
51
|
|
|
45
52
|
## ⚡ Installation
|
|
46
53
|
|
|
@@ -58,13 +65,13 @@ $ npm install generate-pw
|
|
|
58
65
|
|
|
59
66
|
<br>
|
|
60
67
|
|
|
61
|
-
<a href="https://github.com/sponsors/adamlui"><img src="https://
|
|
68
|
+
<a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
|
|
62
69
|
|
|
63
|
-
<img height=6px width="100%" src="https://
|
|
70
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
64
71
|
|
|
65
72
|
## 🔌 Importing the API
|
|
66
73
|
|
|
67
|
-
### <img height=18 src="https://
|
|
74
|
+
### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
|
|
68
75
|
|
|
69
76
|
#### ECMAScript*:
|
|
70
77
|
|
|
@@ -80,28 +87,28 @@ const pw = require('generate-pw');
|
|
|
80
87
|
|
|
81
88
|
###### _*Node.js version 14 or higher required_
|
|
82
89
|
|
|
83
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://
|
|
90
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/platforms/web/light/icon25.png?v=0d36e26"><img width=16 src="https://assets.js-utils.org/images/icons/platforms/web/dark/icon25.png?v=0d36e26"></picture> Web
|
|
84
91
|
|
|
85
92
|
#### <> HTML script tag:
|
|
86
93
|
|
|
87
94
|
```html
|
|
88
|
-
<script src="https://cdn.jsdelivr.net/npm/generate-pw@1.5.
|
|
95
|
+
<script src="https://cdn.jsdelivr.net/npm/generate-pw@1.5.13/dist/generate-pw.min.js"></script>
|
|
89
96
|
```
|
|
90
97
|
|
|
91
98
|
#### ES6:
|
|
92
99
|
|
|
93
100
|
```js
|
|
94
101
|
(async () => {
|
|
95
|
-
await import('https://cdn.jsdelivr.net/npm/generate-pw@1.5.
|
|
102
|
+
await import('https://cdn.jsdelivr.net/npm/generate-pw@1.5.13/dist/generate-pw.min.js');
|
|
96
103
|
// Your code here...
|
|
97
104
|
})();
|
|
98
105
|
```
|
|
99
106
|
|
|
100
|
-
### <img height=17 src="https://
|
|
107
|
+
### <img height=17 src="https://assets.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?v=0d36e26"><img height=17.5 src="https://assets.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?v=0d36e26"> Greasemonkey
|
|
101
108
|
|
|
102
109
|
```js
|
|
103
110
|
...
|
|
104
|
-
// @require https://cdn.jsdelivr.net/npm/generate-pw@1.5.
|
|
111
|
+
// @require https://cdn.jsdelivr.net/npm/generate-pw@1.5.13/dist/generate-pw.min.js
|
|
105
112
|
// ==/UserScript==
|
|
106
113
|
|
|
107
114
|
// Your code here...
|
|
@@ -109,11 +116,11 @@ const pw = require('generate-pw');
|
|
|
109
116
|
|
|
110
117
|
<br>
|
|
111
118
|
|
|
112
|
-
**💡 Note:** To always import the latest version (not recommended in production!) remove the `@1.5.
|
|
119
|
+
**💡 Note:** To always import the latest version (not recommended in production!) remove the `@1.5.13` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-pw/dist/generate-pw.min.js`
|
|
113
120
|
|
|
114
121
|
<br>
|
|
115
122
|
|
|
116
|
-
<img height=6px width="100%" src="https://
|
|
123
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
117
124
|
|
|
118
125
|
## 📋 API usage
|
|
119
126
|
|
|
@@ -250,7 +257,7 @@ Name | Type | Description
|
|
|
250
257
|
|
|
251
258
|
<br>
|
|
252
259
|
|
|
253
|
-
<img height=6px width="100%" src="https://
|
|
260
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
254
261
|
|
|
255
262
|
## 💻 Command line usage
|
|
256
263
|
|
|
@@ -260,7 +267,7 @@ When installed [globally](#-installation), **generate-pw** can also be used from
|
|
|
260
267
|
$ generate-pw
|
|
261
268
|
```
|
|
262
269
|
|
|
263
|
-
<img src="https://media.generatepw.org/images/screenshots/cli/generate-pw-cmd-output.png?
|
|
270
|
+
<img src="https://media.generatepw.org/images/screenshots/cli/generate-pw-cmd-output.png?0d36e26">
|
|
264
271
|
|
|
265
272
|
#
|
|
266
273
|
|
|
@@ -290,11 +297,11 @@ Info commands:
|
|
|
290
297
|
|
|
291
298
|
<br>
|
|
292
299
|
|
|
293
|
-
<img height=6px width="100%" src="https://
|
|
300
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
294
301
|
|
|
295
302
|
## 🏛️ MIT License
|
|
296
303
|
|
|
297
|
-
**Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors.**
|
|
304
|
+
**Copyright © 2024–2026 [Adam Lui](https://github.com/adamlui) & contributors.**
|
|
298
305
|
|
|
299
306
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
300
307
|
|
|
@@ -304,32 +311,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
304
311
|
|
|
305
312
|
<br>
|
|
306
313
|
|
|
307
|
-
<img height=6px width="100%" src="https://
|
|
314
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
308
315
|
|
|
309
316
|
## 🛠️ Related utilities
|
|
310
317
|
|
|
311
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.
|
|
318
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.org/generate-ip) <a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
|
|
312
319
|
|
|
313
320
|
> Randomly generate, format, and validate IPv4 + IPv6 + MAC addresses.
|
|
314
321
|
<br>[Install](https://docs.generate-ip.org/#-installation) /
|
|
315
322
|
[Readme](https://docs.generate-ip.org/#readme) /
|
|
316
323
|
[API usage](https://docs.generate-ip.org/#-api-usage) /
|
|
317
324
|
[CLI usage](https://docs.generate-ip.org/#-command-line-usage) /
|
|
318
|
-
[Discuss](https://github.js-utils
|
|
325
|
+
[Discuss](https://github.com/adamlui/js-utils/discussions)
|
|
319
326
|
|
|
320
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?
|
|
327
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?0d36e26"><img height=22 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?0d36e26"></picture> [geolocate](https://js-utils.org/geolocate) <a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
|
|
321
328
|
|
|
322
329
|
> Fetch IP geolocation data from the CLI.
|
|
323
330
|
<br>[Install](https://docs.geolocatejs.org/#-installation) /
|
|
324
331
|
[Readme](https://docs.geolocatejs.org/#readme) /
|
|
325
332
|
[CLI usage](https://docs.geolocatejs.org/#-command-line-usage) /
|
|
326
333
|
[API usage](https://docs.geolocatejs.org/#-api-usage) /
|
|
327
|
-
[Discuss](https://github.js-utils
|
|
334
|
+
[Discuss](https://github.com/adamlui/js-utils/discussions)
|
|
328
335
|
|
|
329
336
|
<br>
|
|
330
337
|
|
|
331
|
-
<img height=6px width="100%" src="https://
|
|
338
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
332
339
|
|
|
333
|
-
<picture><source media="(prefers-color-scheme: dark)" srcset="https://
|
|
334
|
-
<a href="https://github.js-utils
|
|
340
|
+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/home/white/icon32x27.png?v=0d36e26"><img height=13 src="https://assets.js-utils.org/images/icons/home/dark-gray/icon32x27.png?v=0d36e26"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
|
|
341
|
+
<a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
|
|
335
342
|
<a href="#-generate-pw">Back to top ↑</a>
|
package/dist/cli.min.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* © 2024 Adam Lui & contributors under the MIT license.
|
|
3
|
+
* © 2024–2026 Adam Lui & contributors under the MIT license.
|
|
4
4
|
* Source: https://code.generatepw.org
|
|
5
5
|
* Documentation: https://docs.generatepw.org
|
|
6
6
|
*/
|
|
7
|
-
const pkgName="generate-pw",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="generate-pw [options|commands]",srcURL="https://code.generatepw.org",docURL="https://docs.generatepw.org/#-command-line-usage";(async()=>{const e=require(__dirname.match(/src/)?"./generate-pw":"./generate-pw.min")["generatePassword"],
|
|
8
|
-
${a+(l.prefix_error||"ERROR")}: `+`Arg [--${s.replace(/-/g,"")}] `+`${l.error_noEqual||"requires '=' followed by a value"}.${t}`),
|
|
7
|
+
const pkgName="generate-pw",copyright="© 2024–2026 Adam Lui & contributors under the MIT license.",cmdFormat="generate-pw [options|commands]",srcURL="https://code.generatepw.org",docURL="https://docs.generatepw.org/#-command-line-usage",latestLocaleCommitHash="cc58ad6";(async()=>{"use strict";const e=require(__dirname.match(/src/)?"./generate-pw":"./generate-pw.min")["generatePassword"],o=require("fs"),r=require("path"),{execSync:n,execFileSync:s}=require("child_process"),t="[0m",a="[1;91m",i="[1;97m";let p="en";if("win32"==process.platform)try{p=n("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){_("Error loading system language: "+e)}else{var c=process.env;p=(c.LANG||c.LANGUAGE||c.LC_ALL||c.LC_MESSAGES||c.LC_NAME||"en").split(".")[0]}let l={};var m,d,c=new Promise((t,a)=>{const i=`https://cdn.jsdelivr.net/gh/adamlui/js-utils@7316e70b5cf249a6e4ea74f35d3e43d35f633a15/${pkgName}/_locales/`;var e=`${p?p.replace("-","_"):"en"}/`;let c=i+e+"messages.json",l=0;f(c).then(async function s(e){try{const o=await e.json(),r={};for(const n in o)"object"==typeof o[n]&&"message"in o[n]&&(r[n]=o[n].message);t(r)}catch(e){if(3==++l)return t({});f(c=p.includes("-")&&1==l?c.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):i+"en/messages.json").then(s).catch(a)}}).catch(a)});try{l=await c}catch(e){_("Error fetching messages: "+e)}const u={},h={paramOptions:{length:/^--?length(?:=.*|$)/,qty:/^--?qu?a?n?ti?t?y(?:=.*|$)/,charset:/^--?charse?t?(?:=.*|$)/,excludeChars:/^--?exclude(?:=.*|$)/},flags:{includeNums:/^--?(?:n|(?:include-?)?num(?:ber)?s?=?(?:true|1)?)$/,includeSymbols:/^--?(?:y|(?:include-?)?symbols?=?(?:true|1)?)$/,excludeLowerChars:/^--?(?:L|(?:exclude|disable|no)-?lower-?(?:case)?|lower-?(?:case)?=(?:false|0))$/,excludeUpperChars:/^--?(?:U|(?:exclude|disable|no)-?upper-?(?:case)?|upper-?(?:case)?=(?:false|0))$/,excludeSimilarChars:/^--?(?:S|(?:exclude|disable|no)-?similar-?(?:char(?:acter)?s?)?|similar-?(?:char(?:acter)?s?)?=(?:false|0))$/,strictMode:/^--?s(?:trict)?(?:-?mode)?$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};process.argv.forEach(s=>{var e,o,r;s.startsWith("-")&&(e=Object.keys(h.paramOptions).find(e=>h.paramOptions[e].test(s)),r=Object.keys(h.flags).find(e=>h.flags[e].test(s)),o=Object.keys(h.infoCmds).find(e=>h.infoCmds[e].test(s)),r?u[r]=!0:e?(/=.+/.test(s)||(console.error(`
|
|
8
|
+
${a+(l.prefix_error||"ERROR")}: `+`Arg [--${s.replace(/-/g,"")}] `+`${l.error_noEqual||"requires '=' followed by a value"}.${t}`),w(),process.exit(1)),r=s.split("=")[1],u[e]=parseInt(r)||r):o||(console.error(`
|
|
9
9
|
${a+(l.prefix_error||"ERROR")}: `+`Arg [${s}] ${l.error_notRecognized||"not recognized"}.[0m`),console.info(`
|
|
10
|
-
${"[1;33m"+(l.info_validArgs||"Valid arguments are below")}.[0m`)
|
|
11
|
-
${a+(l.prefix_error||"ERROR")}: [${
|
|
12
|
-
${l.prefix_globalVer||"Global version"}: `+c),console.info(`${l.prefix_localVer||"Local version"}: `+e)}else{c={length:
|
|
13
|
-
${l.info_copying||"Copying to clipboard"}
|
|
14
|
-
|
|
10
|
+
${"[1;33m"+(l.info_validArgs||"Valid arguments are below")}.[0m`),$(["paramOptions","flags","infoCmds"]),process.exit(1)))});for(const y of["length","qty"])u[y]&&(isNaN(u[y])||u[y]<1)&&(console.error(`
|
|
11
|
+
${a+(l.prefix_error||"ERROR")}: [${y}] `+`${l.error_nonPositiveNum||"argument can only be > 0"}.${t}`),w(),process.exit(1));if(process.argv.some(e=>h.infoCmds.help.test(e)))$();else if(process.argv.some(e=>h.infoCmds.version.test(e))){c=n(`npm view ${pkgName} version`).toString().trim()||"none";let e,s=process.cwd();for(;"/"!=s;){var g=r.join(s,"package.json");if(o.existsSync(g)){g=require(g);e=(g.dependencies?.[pkgName]||g.devDependencies?.[pkgName])?.match(/^[~^>=]?\d+\.\d+\.\d+$/)?.[1]||"none";break}s=r.dirname(s)}console.info(`
|
|
12
|
+
${l.prefix_globalVer||"Global version"}: `+c),console.info(`${l.prefix_localVer||"Local version"}: `+e)}else{c={length:u.length||8,qty:u.qty||1,charset:u.charset,exclude:u.excludeChars,numbers:!!u.includeNums,symbols:!!u.includeSymbols,lowercase:!u.excludeLowerChars,uppercase:!u.excludeUpperChars,excludeSimilarChars:!!u.excludeSimilarChars,strict:!!u.strictMode,verbose:!u.quietMode},c=e(c);_(`
|
|
13
|
+
${l.info_copying||"Copying to clipboard"}...`),m=(m=Array.isArray(c)?c.join("\n"):c).replace(/"/g,'""'),d={darwin:{binPath:"/usr/bin/pbcopy",args:[]},linux:{binPath:"/usr/bin/xclip",args:["-selection","clipboard"]},win32:{binPath:r.join(process.env.SYSTEMROOT,"System32","WindowsPowerShell","v1.0","powershell.exe"),args:["-Command","Set-Clipboard -Value $input"]}},s(...Object.values(d[process.platform]),{input:m})}function f(r){return new Promise((o,e)=>{var s=r.match(/^([^:]+):\/\//)[1];/^https?$/.test(s)||e(new Error(`${l.error_invalidURL||"Invalid URL"}.`)),require(s).get(r,e=>{let s="";e.on("data",e=>s+=e),e.on("end",()=>o({json:()=>JSON.parse(s)}))}).on("error",e)})}function $(e=["header","usage","paramOptions","flags","infoCmds"]){var s=`[106m[30m ${pkgName} [0m `;const o={header:[`
|
|
14
|
+
├ `+s+(l.appCopyright||copyright),s+(l.prefix_source||"Source")+": "+srcURL],usage:[`
|
|
15
|
+
${i}o ${l.helpSection_usage||"Usage"}:[0m`,` ${i}» [1;92m${cmdFormat}[0m`],paramOptions:[`
|
|
15
16
|
${i}o ${l.helpSection_paramOptions||"Parameter options"}:[0m`,` --length=n ${l.optionDesc_length||"Generate password(s) of n length"}.`,` --qty=n ${l.optionDesc_qty||"Generate n password(s)"}.`,` --charset=chars ${l.optionDesc_charset||"Only include chars in password(s)"}.`,` --exclude=chars ${l.optionDesc_exclude||"Exclude chars from password(s)"}.`],flags:[`
|
|
16
17
|
${i}o ${l.helpSection_flags||"Boolean options"}:[0m`,` -n, --include-numbers ${l.optionDesc_includeNums||"Allow numbers in password(s)"}.`,` -y, --include-symbols ${l.optionDesc_includeSymbols||"Allow symbols in password(s)"}.`,` -L, --no-lowercase ${l.optionDesc_noLower||"Disallow lowercase letters in password(s)"}.`,` -U, --no-uppercase ${l.optionDesc_noUpper||"Disallow uppercase letters in password(s)"}.`,` -S, --no-similar ${l.optionDesc_noSimilar||"Exclude similar characters in password(s)"}.`,` -s, --strict ${l.optionDesc_strict||"Require at least one character from eachallowed character set in password(s)"}.`,` -q, --quiet ${l.optionDesc_quiet||"Suppress all logging except errors"}.`],infoCmds:[`
|
|
17
|
-
${i}o ${l.helpSection_infoCmds||"Info commands"}:[0m`," -h, --help "+(l.optionDesc_help||"Display help screen."),` -v, --version ${l.optionDesc_version||"Show version number"}.`]};e.forEach(a=>
|
|
18
|
-
${l.info_moreHelp||"For more help"}, ${l.info_visit||"visit"}:
|
|
19
|
-
${l.info_moreHelp||"For more help"}
|
|
20
|
-
|
|
18
|
+
${i}o ${l.helpSection_infoCmds||"Info commands"}:[0m`," -h, --help "+(l.optionDesc_help||"Display help screen."),` -v, --version ${l.optionDesc_version||"Show version number"}.`]};e.forEach(a=>o[a]?.forEach(e=>{{var r=/header|usage/.test(a)?1:29;const n=process.stdout.columns||80,t=[],s=e.match(/\S+|\s+/g);let o="";s.forEach(e=>{var s=n-(t.length?r:0);o.length+"| ".length+e.length>s&&(t.push(t.length?o.trimStart():o),o=""),o+=e}),t.push(t.length?o.trimStart():o),t.forEach((e,s)=>console.info("| "+(0==s?e:" ".repeat(r)+e)))}})),console.info(`
|
|
19
|
+
${l.info_moreHelp||"For more help"}, ${l.info_visit||"visit"}: ${i}${docURL}[0m`)}function w(){console.info(`
|
|
20
|
+
${l.info_moreHelp||"For more help"}, ${l.info_type||"type"} generate-pw --help' ${l.info_or||"or"} ${l.info_visit||"visit"}
|
|
21
|
+
${i}${docURL}[0m`)}function _(e){u.quietMode||console.info(e)}})();
|
package/dist/generate-pw.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* © 2024 Adam Lui & contributors under the MIT license.
|
|
2
|
+
* © 2024–2026 Adam Lui & contributors under the MIT license.
|
|
3
3
|
* Source: https://code.generatepw.org
|
|
4
4
|
* Documentation: https://docs.generatepw.org
|
|
5
5
|
*/
|
|
6
|
-
const charsets={lower:"abcdefghijklmnopqrstuvwxyz",upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numbers:"0123456789",symbols:"!@#$%^&*()-_=+[]{}/\\|;:'\",.<>?"};function generatePassword(t={}){var e={verbose:!0,length:8,qty:1,charset:"",exclude:"",numbers:!1,symbols:!1,lowercase:!0,uppercase:!0,excludeSimilarChars:!1,strict:!1};if(validateOptions(t,e,"https://docs.generatepw.org/#generatepasswordoptions","generatePassword({ verbose: false, numbers: true })")){if(1<(t={...e,...t}).qty){const{qty:r,...s}=t;return generatePasswords(r,s)}{var o,e="generatePasswords"==generatePassword.caller?.name;t.verbose&&!e&&console.info("generatePassword() » Initializing character set...");let r=t.charset?.toString()||(t.numbers?charsets.numbers:"")+(t.symbols?charsets.symbols:"")+(t.lowercase?charsets.lower:"")+(t.uppercase?charsets.upper:""),s=(""==r&&(r=charsets.lower+charsets.upper),t.exclude&&(t.verbose&&!e&&console.info("generatePassword() » Removing excluded characters..."),r=r.replace(new RegExp(`[${t.exclude}]`,"g"),"")),t.excludeSimilarChars&&(t.verbose&&!e&&console.info("generatePassword() » Excluding similar characters..."),r=r.replace(/[o0Oil1|]/g,"")),t.verbose&&!e&&console.info("generatePassword() » Generating password..."),"");for(let e=0;e<t.length;e++){var n=randomInt(0,r.length);s+=r
|
|
6
|
+
const charsets={lower:"abcdefghijklmnopqrstuvwxyz",upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numbers:"0123456789",symbols:"!@#$%^&*()-_=+[]{}/\\|;:'\",.<>?"};function generatePassword(t={}){var e={verbose:!0,length:8,qty:1,charset:"",exclude:"",numbers:!1,symbols:!1,lowercase:!0,uppercase:!0,excludeSimilarChars:!1,strict:!1};if(validateOptions(t,e,"https://docs.generatepw.org/#generatepasswordoptions","generatePassword({ verbose: false, numbers: true })")){if(1<(t={...e,...t}).qty){const{qty:r,...s}=t;return generatePasswords(r,s)}{var o,e="generatePasswords"==generatePassword.caller?.name;t.verbose&&!e&&console.info("generatePassword() » Initializing character set...");let r=t.charset?.toString()||(t.numbers?charsets.numbers:"")+(t.symbols?charsets.symbols:"")+(t.lowercase?charsets.lower:"")+(t.uppercase?charsets.upper:""),s=(""==r&&(r=charsets.lower+charsets.upper),t.exclude&&(t.verbose&&!e&&console.info("generatePassword() » Removing excluded characters..."),r=r.replace(new RegExp(`[${t.exclude}]`,"g"),"")),t.excludeSimilarChars&&(t.verbose&&!e&&console.info("generatePassword() » Excluding similar characters..."),r=r.replace(/[o0Oil1|]/g,"")),t.verbose&&!e&&console.info("generatePassword() » Generating password..."),"");for(let e=0;e<t.length;e++){var n=randomInt(0,r.length);s+=r[n]}return t.strict&&(t.verbose&&!e&&console.info("generatePassword() » Enforcing strict mode..."),o=["number","symbol","lower","upper"].filter(e=>t[e+"s"]||t[e+"case"]),s=strictify(s,o)),t.verbose&&!e&&(console.info("generatePassword() » Password generated!"),"undefined"!=typeof window)&&console.info("generatePassword() » Check returned string."),s}}}function generatePasswords(r,s={}){var e="https://docs.generatepw.org/#generatepasswordsqty-options",t={verbose:!0,length:8,charset:"",exclude:"",numbers:!1,symbols:!1,lowercase:!0,uppercase:!0,excludeSimilarChars:!1,strict:!1};if(r=parseInt(r,10),isNaN(r)||r<1)console.error("generatePasswords() » ERROR: 1st arg <qty> can only be an integer > 0."),console.info("generatePasswords() » For more help, please visit "+e);else if(validateOptions(s,t,e,"generatePasswords(3, { verbose: false, symbols: true })")){(s={...t,...s}).verbose&&console.info(`generatePasswords() » Generating password${1<r?"s":""}...`);var o=[];for(let e=0;e<r;e++)o.push(generatePassword(s));return s.verbose&&(console.info(`generatePasswords() » Password${1<r?"s":""} generated!`),"undefined"!=typeof window)&&console.info("generatePasswords() » Check returned array."),o}}function strictify(t,o=["number","symbol","lower","upper"],e={}){var r="https://docs.generatepw.org/#strictifypassword-requiredchartypes-options",n={verbose:!0};if("string"!=typeof t)console.error("strictify() » ERROR: 1st arg <password> must be a string."),console.info("strictify() » For more help, please visit "+r);else{var s=["number","symbol","lower","upper"];for(const l of o=Array.isArray(o)?o:[o])if(!s.includes(l))return console.error(`strictify() » ERROR: 2nd arg \`${l}\` is an invalid character type.`),console.info(`strictify() » Valid character types: [ '${s.join("', '")}' ]`),console.info("strictify() » Pass one as a string or more as an array, or all types will be required."),void console.info("strictify() » For more help, please visit "+r);if(validateOptions(e,n,r,"strictify('pa55word', ['symbol', 'upper'], { verbose: false })")){e={...n,...e};const c={},d=[];o.forEach(e=>c[e]=!1);for(let e=0;e<t.length;e++)for(const p of o)(charsets[p]||charsets[p+"s"]).includes(t[e])&&(c[p]=!0,d.push(e));e.verbose&&console.info("strictify() » Strictifying password...");var a=Math.min(t.length,o.length);let r=0,s=t;for(const g of o)if(r<a&&!c[g]){let e;for(;e=randomInt(0,t.length),d.includes(e););d.push(e);var i=charsets[g]||charsets[g+"s"];s=s.substring(0,e)+i[randomInt(0,i.length)]+s.substring(e+1),r++}return e.verbose&&(0<r?(console.info("strictify() » Password is now strict!"),console.info("strictify() » Check returned string.")):(console.info(`strictify() » Password already includes ${o.join(" + ")} characters!`),console.info("strictify() » No modifications made."))),s}}}function validateStrength(r,s={}){var e="https://docs.generatepw.org/#validatestrengthpassword-options",t={minLength:8,minLower:1,minUpper:1,minNumber:1,minSymbol:1},o={verbose:!0};if("string"!=typeof r)console.error("validateStrength() » ERROR: 1st arg <password> must be a string."),console.info("validateStrength() » For more help, please visit "+e);else if(validateOptions(s,o,e,"validateStrength('pa55word', { verbose: false })")){(s={...o,...s}).verbose&&console.info("validateStrength() » Validating password strength...");var n={lower:0,upper:0,number:0,symbol:0};for(const i of r)for(const l of Object.keys(n))(charsets[l]||charsets[l+"s"]).includes(i)&&n[l]++;var a=[];r.length<t.minLength&&a.push(`Make it at least ${t.minLength} characters long.`);for(const c of Object.keys(n))n[c]<t["min"+c[0].toUpperCase()+c.slice(1)]&&a.push("Include at least one "+c+`${["upper","lower"].includes(c)?"case letter":""}.`);let e=0;e+=r.length>=t.minLength?20:0;for(const d of Object.keys(n))e+=n[d]>=t["min"+d[0].toUpperCase()+d.slice(1)]?20:0;return s.verbose&&(console.info("validateStrength() » Password strength validated!"),console.info("validateStrength() » Check returned object for score/recommendations.")),{strengthScore:e,recommendations:a,isGood:80<=e}}}function randomInt(e,r){var s;return"undefined"==typeof require?(s=(window.crypto||window.msCrypto)?.getRandomValues(new Uint32Array(1))[0]/4294967295||Math.random(),Math.floor(s*(r-e))+e):require("crypto").randomInt(e,r)}function validateOptions(e,r,s,t){const o=JSON.stringify(r,void 0,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),n=Object.keys(r).join(", "),a=Object.keys(r).filter(e=>"boolean"==typeof r[e]),i=Object.keys(r).filter(e=>Number.isInteger(r[e])),l=`${validateOptions.caller?.name||"validateOptions"}() » `;var c=t.split(",").findIndex(e=>e.trim().startsWith("{"))+1,d=(c+=["st","nd","rd"][c-1]||"th",()=>{console.info(l+`Valid options: [ ${n} ]`),console.info(l+"If omitted, default settings are: "+o)}),p=()=>{console.info(l+"For more help, please visit "+s)};if("object"!=typeof e)return console.error(l+`ERROR: ${"0th"==c?"[O":c+" arg [o"}ptions] can only be an object of key/values.`),console.info(l+"Example valid call: "+t),d(),p(),!1;for(const g in e){if(!Object.prototype.hasOwnProperty.call(r,g))return console.error(l+`ERROR: \`${g}\` is an invalid option.`),d(),p(),!1;if(a.includes(g)&&"boolean"!=typeof e[g])return console.error(l+`ERROR: [${g}] option can only be \`true\` or \`false\`.`),p(),!1;if(i.includes(g)&&(e[g]=parseInt(e[g],10),isNaN(e[g])||e[g]<1))return console.error(l+`ERROR: [${g}] option can only be an integer > 0.`),p(),!1}return!0}const gpwAliases={generatePassword:["generate","generatepassword","generatepw","generatePw","generatePW","Generate","Generatepassword","GeneratePassword","Generatepw","GeneratePw","GeneratePW"],generatePasswords:["generatepasswords","generatepws","generatePws","generatePWs","generatePWS","Generatepasswords","GeneratePasswords","Generatepws","GeneratePws","GeneratePWs","GeneratePWS"],strictify:["Strictify"],validateStrength:["validate","Validate","validatestrength","Validatestrength","ValidateStrength"]},gpwFuncs={generatePassword:generatePassword,generatePasswords:generatePasswords,strictify:strictify,validateStrength:validateStrength};try{module.exports={...gpwFuncs}}catch(e){}try{window.pw={...gpwFuncs}}catch(e){}for(const va in gpwAliases){try{gpwAliases[va].forEach(e=>module.exports[e]=module.exports[va])}catch(e){}try{gpwAliases[va].forEach(e=>window.pw[e]=window.pw[va])}catch(e){}}
|
package/docs/LICENSE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="right">
|
|
2
2
|
<h6>
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://
|
|
5
|
-
<img height=14 src="https://
|
|
4
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/earth/white/icon32.svg?v=7c33be0">
|
|
5
|
+
<img height=14 src="https://assets.js-utils.org/images/icons/earth/black/icon32.svg?v=7c33be0">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="zh-cn/LICENSE.md">简体中文</a> |
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
# 🏛️ MIT License
|
|
19
19
|
|
|
20
|
-
**Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors**
|
|
20
|
+
**Copyright © 2024–2026 [Adam Lui](https://github.com/adamlui) & contributors**
|
|
21
21
|
|
|
22
22
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
23
23
|
|
package/docs/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="right">
|
|
2
2
|
<h6>
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://
|
|
5
|
-
<img height=14 src="https://
|
|
4
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/earth/white/icon32.svg?v=7c33be0">
|
|
5
|
+
<img height=14 src="https://assets.js-utils.org/images/icons/earth/black/icon32.svg?v=7c33be0">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-cn#readme">简体中文</a> |
|
|
@@ -19,17 +19,24 @@
|
|
|
19
19
|
|
|
20
20
|
### Randomly generate, strengthen, and validate cryptographically-secure passwords.
|
|
21
21
|
|
|
22
|
-
<a href="https://www.npmjs.com/package/generate-pw"
|
|
23
|
-
<
|
|
24
|
-
<a href="
|
|
25
|
-
<
|
|
26
|
-
<a href="https://github.com/adamlui/js-utils/
|
|
27
|
-
<
|
|
28
|
-
<a href="https://
|
|
22
|
+
<a href="https://www.npmjs.com/package/generate-pw">
|
|
23
|
+
<img height=31 src="https://img.shields.io/npm/dm/generate-pw?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
24
|
+
<a href="#%EF%B8%8F-mit-license">
|
|
25
|
+
<img height=31 src="https://img.shields.io/badge/License-MIT-fc4f2d.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
26
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/generate-pw-1.5.13">
|
|
27
|
+
<img height=31 src="https://img.shields.io/badge/Latest_Build-1.5.13-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
28
|
+
<a href="https://www.npmjs.com/package/generate-pw?activeTab=code">
|
|
29
|
+
<img height=31 src="https://img.shields.io/npm/unpacked-size/generate-pw?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
|
|
30
|
+
<a href="https://github.com/adamlui/js-utils/blob/generate-pw-1.5.13/generate-pw/dist/generate-pw.min.js">
|
|
31
|
+
<img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/generate-pw/dist/generate-pw.min.js?branch=generate-pw-1.5.13&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
|
|
32
|
+
<a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-pw/src/generate-pw.js">
|
|
33
|
+
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Agenerate-pw%2Fsrc%2Fgenerate-pw.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
|
|
34
|
+
<a href="https://github.com/toolleeo/cli-apps#password-managers">
|
|
35
|
+
<img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
29
36
|
|
|
30
37
|
<br>
|
|
31
38
|
|
|
32
|
-
<img height=6px width="100%" src="https://
|
|
39
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
33
40
|
|
|
34
41
|
## 💡 About
|
|
35
42
|
|
|
@@ -40,7 +47,7 @@
|
|
|
40
47
|
- **Multi-environment support —** Use in Node.js or the web browser
|
|
41
48
|
- **Command line usable —** Just type `generate-pw`, that's it
|
|
42
49
|
|
|
43
|
-
<img height=6px width="100%" src="https://
|
|
50
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
44
51
|
|
|
45
52
|
## ⚡ Installation
|
|
46
53
|
|
|
@@ -58,13 +65,13 @@ $ npm install generate-pw
|
|
|
58
65
|
|
|
59
66
|
<br>
|
|
60
67
|
|
|
61
|
-
<a href="https://github.com/sponsors/adamlui"><img src="https://
|
|
68
|
+
<a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
|
|
62
69
|
|
|
63
|
-
<img height=6px width="100%" src="https://
|
|
70
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
64
71
|
|
|
65
72
|
## 🔌 Importing the API
|
|
66
73
|
|
|
67
|
-
### <img height=18 src="https://
|
|
74
|
+
### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
|
|
68
75
|
|
|
69
76
|
#### ECMAScript*:
|
|
70
77
|
|
|
@@ -80,28 +87,28 @@ const pw = require('generate-pw');
|
|
|
80
87
|
|
|
81
88
|
###### _*Node.js version 14 or higher required_
|
|
82
89
|
|
|
83
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://
|
|
90
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/platforms/web/light/icon25.png?v=0d36e26"><img width=16 src="https://assets.js-utils.org/images/icons/platforms/web/dark/icon25.png?v=0d36e26"></picture> Web
|
|
84
91
|
|
|
85
92
|
#### <> HTML script tag:
|
|
86
93
|
|
|
87
94
|
```html
|
|
88
|
-
<script src="https://cdn.jsdelivr.net/npm/generate-pw@1.5.
|
|
95
|
+
<script src="https://cdn.jsdelivr.net/npm/generate-pw@1.5.13/dist/generate-pw.min.js"></script>
|
|
89
96
|
```
|
|
90
97
|
|
|
91
98
|
#### ES6:
|
|
92
99
|
|
|
93
100
|
```js
|
|
94
101
|
(async () => {
|
|
95
|
-
await import('https://cdn.jsdelivr.net/npm/generate-pw@1.5.
|
|
102
|
+
await import('https://cdn.jsdelivr.net/npm/generate-pw@1.5.13/dist/generate-pw.min.js');
|
|
96
103
|
// Your code here...
|
|
97
104
|
})();
|
|
98
105
|
```
|
|
99
106
|
|
|
100
|
-
### <img height=17 src="https://
|
|
107
|
+
### <img height=17 src="https://assets.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?v=0d36e26"><img height=17.5 src="https://assets.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?v=0d36e26"> Greasemonkey
|
|
101
108
|
|
|
102
109
|
```js
|
|
103
110
|
...
|
|
104
|
-
// @require https://cdn.jsdelivr.net/npm/generate-pw@1.5.
|
|
111
|
+
// @require https://cdn.jsdelivr.net/npm/generate-pw@1.5.13/dist/generate-pw.min.js
|
|
105
112
|
// ==/UserScript==
|
|
106
113
|
|
|
107
114
|
// Your code here...
|
|
@@ -109,11 +116,11 @@ const pw = require('generate-pw');
|
|
|
109
116
|
|
|
110
117
|
<br>
|
|
111
118
|
|
|
112
|
-
**💡 Note:** To always import the latest version (not recommended in production!) remove the `@1.5.
|
|
119
|
+
**💡 Note:** To always import the latest version (not recommended in production!) remove the `@1.5.13` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-pw/dist/generate-pw.min.js`
|
|
113
120
|
|
|
114
121
|
<br>
|
|
115
122
|
|
|
116
|
-
<img height=6px width="100%" src="https://
|
|
123
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
117
124
|
|
|
118
125
|
## 📋 API usage
|
|
119
126
|
|
|
@@ -250,7 +257,7 @@ Name | Type | Description
|
|
|
250
257
|
|
|
251
258
|
<br>
|
|
252
259
|
|
|
253
|
-
<img height=6px width="100%" src="https://
|
|
260
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
254
261
|
|
|
255
262
|
## 💻 Command line usage
|
|
256
263
|
|
|
@@ -260,7 +267,7 @@ When installed [globally](#-installation), **generate-pw** can also be used from
|
|
|
260
267
|
$ generate-pw
|
|
261
268
|
```
|
|
262
269
|
|
|
263
|
-
<img src="https://media.generatepw.org/images/screenshots/cli/generate-pw-cmd-output.png?
|
|
270
|
+
<img src="https://media.generatepw.org/images/screenshots/cli/generate-pw-cmd-output.png?0d36e26">
|
|
264
271
|
|
|
265
272
|
#
|
|
266
273
|
|
|
@@ -290,11 +297,11 @@ Info commands:
|
|
|
290
297
|
|
|
291
298
|
<br>
|
|
292
299
|
|
|
293
|
-
<img height=6px width="100%" src="https://
|
|
300
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
294
301
|
|
|
295
302
|
## 🏛️ MIT License
|
|
296
303
|
|
|
297
|
-
**Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors.**
|
|
304
|
+
**Copyright © 2024–2026 [Adam Lui](https://github.com/adamlui) & contributors.**
|
|
298
305
|
|
|
299
306
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
300
307
|
|
|
@@ -304,32 +311,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
304
311
|
|
|
305
312
|
<br>
|
|
306
313
|
|
|
307
|
-
<img height=6px width="100%" src="https://
|
|
314
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
308
315
|
|
|
309
316
|
## 🛠️ Related utilities
|
|
310
317
|
|
|
311
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.
|
|
318
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.org/generate-ip) <a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
|
|
312
319
|
|
|
313
320
|
> Randomly generate, format, and validate IPv4 + IPv6 + MAC addresses.
|
|
314
321
|
<br>[Install](https://docs.generate-ip.org/#-installation) /
|
|
315
322
|
[Readme](https://docs.generate-ip.org/#readme) /
|
|
316
323
|
[API usage](https://docs.generate-ip.org/#-api-usage) /
|
|
317
324
|
[CLI usage](https://docs.generate-ip.org/#-command-line-usage) /
|
|
318
|
-
[Discuss](https://github.js-utils
|
|
325
|
+
[Discuss](https://github.com/adamlui/js-utils/discussions)
|
|
319
326
|
|
|
320
|
-
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?
|
|
327
|
+
### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?0d36e26"><img height=22 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?0d36e26"></picture> [geolocate](https://js-utils.org/geolocate) <a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
|
|
321
328
|
|
|
322
329
|
> Fetch IP geolocation data from the CLI.
|
|
323
330
|
<br>[Install](https://docs.geolocatejs.org/#-installation) /
|
|
324
331
|
[Readme](https://docs.geolocatejs.org/#readme) /
|
|
325
332
|
[CLI usage](https://docs.geolocatejs.org/#-command-line-usage) /
|
|
326
333
|
[API usage](https://docs.geolocatejs.org/#-api-usage) /
|
|
327
|
-
[Discuss](https://github.js-utils
|
|
334
|
+
[Discuss](https://github.com/adamlui/js-utils/discussions)
|
|
328
335
|
|
|
329
336
|
<br>
|
|
330
337
|
|
|
331
|
-
<img height=6px width="100%" src="https://
|
|
338
|
+
<img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
|
|
332
339
|
|
|
333
|
-
<picture><source media="(prefers-color-scheme: dark)" srcset="https://
|
|
334
|
-
<a href="https://github.js-utils
|
|
340
|
+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/home/white/icon32x27.png?v=0d36e26"><img height=13 src="https://assets.js-utils.org/images/icons/home/dark-gray/icon32x27.png?v=0d36e26"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
|
|
341
|
+
<a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
|
|
335
342
|
<a href="#-generate-pw">Back to top ↑</a>
|
package/docs/SECURITY.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="right">
|
|
2
2
|
<h6>
|
|
3
3
|
<picture>
|
|
4
|
-
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://
|
|
5
|
-
<img height=14 src="https://
|
|
4
|
+
<source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/earth/white/icon32.svg?v=7c33be0">
|
|
5
|
+
<img height=14 src="https://assets.js-utils.org/images/icons/earth/black/icon32.svg?v=7c33be0">
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="zh-cn/SECURITY.md">简体中文</a> |
|
|
@@ -17,6 +17,4 @@
|
|
|
17
17
|
|
|
18
18
|
# 🛡️ Security Policy
|
|
19
19
|
|
|
20
|
-
If you find a vulnerability, please
|
|
21
|
-
|
|
22
|
-
Pull requests are also welcome, but for safety reasons, send an email to <adam@kudoai.com> and wait for a response before making it public.
|
|
20
|
+
If you find a vulnerability, please follow the reporting instructions @ https://tidelift.com/security
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generate-pw",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.13",
|
|
4
4
|
"description": "Randomly generate, strengthen, and validate cryptographically-secure passwords.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Adam Lui",
|
|
@@ -9,6 +9,24 @@
|
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://generatepw.org",
|
|
11
11
|
"license": "MIT",
|
|
12
|
+
"funding": [
|
|
13
|
+
{
|
|
14
|
+
"type": "cashapp",
|
|
15
|
+
"url": "https://cash.app/$AdamLui"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "github",
|
|
19
|
+
"url": "http://github.com/sponsors/adamlui"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "ko-fi",
|
|
23
|
+
"url": "https://ko-fi.com/adamlui"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "paypal",
|
|
27
|
+
"url": "https://paypal.me/adamlui"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
12
30
|
"main": "dist/generate-pw.min.js",
|
|
13
31
|
"files": [
|
|
14
32
|
"docs/",
|
|
@@ -23,14 +41,10 @@
|
|
|
23
41
|
"doc": "./docs"
|
|
24
42
|
},
|
|
25
43
|
"scripts": {
|
|
26
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
27
44
|
"build": "bash utils/build.sh",
|
|
28
45
|
"bump:patch": "bash utils/bump.sh patch",
|
|
29
46
|
"bump:minor": "bash utils/bump.sh minor",
|
|
30
|
-
"bump:major": "bash utils/bump.sh major"
|
|
31
|
-
"publish:patch": "bash utils/bump.sh patch --publish",
|
|
32
|
-
"publish:minor": "bash utils/bump.sh minor --publish",
|
|
33
|
-
"publish:major": "bash utils/bump.sh major --publish"
|
|
47
|
+
"bump:major": "bash utils/bump.sh major"
|
|
34
48
|
},
|
|
35
49
|
"repository": {
|
|
36
50
|
"type": "git",
|
|
@@ -45,13 +59,9 @@
|
|
|
45
59
|
"cli"
|
|
46
60
|
],
|
|
47
61
|
"bugs": {
|
|
48
|
-
"url": "https://
|
|
49
|
-
},
|
|
50
|
-
"funding": {
|
|
51
|
-
"type": "github",
|
|
52
|
-
"url": "https://github.com/sponsors/adamlui"
|
|
62
|
+
"url": "https://support.generatepw.org"
|
|
53
63
|
},
|
|
54
64
|
"devDependencies": {
|
|
55
|
-
"@adamlui/minify.js": "^1.8.
|
|
65
|
+
"@adamlui/minify.js": "^1.8.6"
|
|
56
66
|
}
|
|
57
67
|
}
|