generate-pw 2.2.0 → 2.3.1

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 CHANGED
@@ -3,17 +3,17 @@
3
3
  <div align="right">
4
4
  <h6>
5
5
  <picture>
6
- <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/earth/white/icon32.svg?v=7c33be0">
7
- <img height=14 src="https://assets.js-utils.org/images/icons/earth/black/icon32.svg?v=7c33be0">
6
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@f2dc346/assets/images/icons/earth/white/icon32.svg">
7
+ <img height=14 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@f2dc346/assets/images/icons/earth/black/icon32.svg">
8
8
  </picture>
9
9
  &nbsp;English |
10
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-cn#readme">简体中文</a> |
11
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-tw#readme">繁體中文</a> |
12
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/hi#readme">हिंदी</a> |
13
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/bn#readme">বাংলা</a> |
14
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/de#readme">Deutsch</a> |
15
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/es#readme">Español</a> |
16
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/fr#readme">Français</a>
10
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-cn/#readme">简体中文</a> |
11
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-tw/#readme">繁體中文</a> |
12
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/hi/#readme">हिंदी</a> |
13
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/bn/#readme">বাংলা</a> |
14
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/de/#readme">Deutsch</a> |
15
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/es/#readme">Español</a> |
16
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/fr/#readme">Français</a>
17
17
  </h6>
18
18
  </div>
19
19
 
@@ -21,24 +21,22 @@
21
21
 
22
22
  ### Randomly generate, strengthen, and validate cryptographically-secure passwords.
23
23
 
24
- <a href="https://www.npmjs.com/package/generate-pw">
24
+ <a href="https://npmstar.com/compare/generate-pw">
25
25
  <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>
26
26
  <a href="#%EF%B8%8F-mit-license">
27
27
  <img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
28
- <a href="https://github.com/adamlui/js-utils/releases/tag/generate-pw-2.2.0">
29
- <img height=31 src="https://img.shields.io/badge/Latest_Build-2.2.0-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
28
+ <a href="https://github.com/adamlui/js-utils/releases/tag/generate-pw-2.3.1">
29
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.3.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
30
30
  <a href="https://www.npmjs.com/package/generate-pw?activeTab=code">
31
31
  <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>
32
- <a href="#">
33
- <img height=31 src="https://img.shields.io/bundlejs/size/generate-pw%402.1.2?label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
34
32
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-pw/src/generate-pw.js">
35
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>
36
- <a href="https://github.com/toolleeo/cli-apps#password-managers">
34
+ <a href="https://github.com/toolleeo/cli-apps/#password-managers">
37
35
  <img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-ff69b4?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
38
36
 
39
37
  <br>
40
38
 
41
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
39
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
42
40
 
43
41
  ## 💡 About
44
42
 
@@ -49,7 +47,7 @@
49
47
  - **Multi-environment support —** Use in Node.js or the web browser
50
48
  - **Command line usable —** Just type `generate-pw`, that's it
51
49
 
52
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
50
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
53
51
 
54
52
  ## ⚡ Installation
55
53
 
@@ -67,13 +65,13 @@ $ npm install generate-pw
67
65
 
68
66
  <br>
69
67
 
70
- <a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
68
+ <a href="https://github.com/sponsors/adamlui"><img src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/banners/sponsor/$10/banner1660x260.png"></a>
71
69
 
72
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
70
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
73
71
 
74
72
  ## 🔌 Importing the API
75
73
 
76
- ### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
74
+ ### <img height=18 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/node.js/icon25x28.png"> Node.js
77
75
 
78
76
  #### ECMAScript*:
79
77
 
@@ -89,28 +87,28 @@ const pw = require('generate-pw')
89
87
 
90
88
  ###### _*Node.js version 14 or higher required_
91
89
 
92
- ### <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
90
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/web/light/icon25.png"><img width=16 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/web/dark/icon25.png"></picture> Web
93
91
 
94
92
  #### <> HTML script tag:
95
93
 
96
94
  ```html
97
- <script src="https://cdn.jsdelivr.net/npm/generate-pw@2.2.0/dist/generate-pw.min.js"></script>
95
+ <script src="https://cdn.jsdelivr.net/npm/generate-pw@2.3.1/dist/generate-pw.min.js"></script>
98
96
  ```
99
97
 
100
98
  #### ES6:
101
99
 
102
100
  ```js
103
101
  (async () => {
104
- await import('https://cdn.jsdelivr.net/npm/generate-pw@2.2.0/dist/generate-pw.min.js')
102
+ await import('https://cdn.jsdelivr.net/npm/generate-pw@2.3.1/dist/generate-pw.min.js')
105
103
  // Your code here...
106
104
  })()
107
105
  ```
108
106
 
109
- ### <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
107
+ ### <img height=17 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/tampermonkey/icon28.png"><img height=17.5 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/violentmonkey/icon25.png"> Greasemonkey
110
108
 
111
109
  ```js
112
110
  ...
113
- // @require https://cdn.jsdelivr.net/npm/generate-pw@2.2.0/dist/generate-pw.min.js
111
+ // @require https://cdn.jsdelivr.net/npm/generate-pw@2.3.1/dist/generate-pw.min.js
114
112
  // ==/UserScript==
115
113
 
116
114
  // Your code here...
@@ -118,11 +116,11 @@ const pw = require('generate-pw')
118
116
 
119
117
  <br>
120
118
 
121
- **💡 Note:** To always import the latest version (not recommended in production!) remove the `@2.2.0` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-pw/dist/generate-pw.min.js`
119
+ **💡 Note:** To always import the latest version (not recommended in production!) remove the `@2.3.1` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-pw/dist/generate-pw.min.js`
122
120
 
123
121
  <br>
124
122
 
125
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
123
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
126
124
 
127
125
  ## 📋 API usage
128
126
 
@@ -261,17 +259,17 @@ Name | Type | Description
261
259
 
262
260
  <br>
263
261
 
264
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
262
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
265
263
 
266
264
  ## 💻 Command line usage
267
265
 
268
- When installed [globally](#-installation), **generate-pw** can also be used from the command line. The basic command is:
266
+ **generate-pw** can also be used directly from the command line. The basic command is:
269
267
 
270
268
  ```
271
269
  $ generate-pw
272
270
  ```
273
271
 
274
- <img src="https://media.generatepw.org/images/screenshots/cli/generate-pw-cmd-output.png?0d36e26">
272
+ <img src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d3424a/generate-pw/assets/images/screenshots/cli/generate-pw-cmd-output.png">
275
273
 
276
274
  #
277
275
 
@@ -338,7 +336,7 @@ export default {
338
336
 
339
337
  <br>
340
338
 
341
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
339
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
342
340
 
343
341
  ## 🏛️ MIT License
344
342
 
@@ -352,11 +350,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
352
350
 
353
351
  <br>
354
352
 
355
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
353
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
356
354
 
357
355
  ## 🛠️ Related utilities
358
356
 
359
- ### <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) &nbsp;<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>
357
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@5c34563/generate-ip/assets/images/icons/node-graph/white/icon55x49.png"><img height=21 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@5c34563/generate-ip/assets/images/icons/node-graph/black/icon55x49.png"></picture> [generate-ip](https://js-utils.org/generate-ip) &nbsp;<a href="https://github.com/toolleeo/cli-apps/#networking"><img height=18 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/badges/awesome/badge.svg"></a>
360
358
 
361
359
  > Randomly generate, format, and validate IPv4 + IPv6 + MAC addresses.
362
360
  <br>[Install](https://docs.generate-ip.org/#-installation) /
@@ -365,7 +363,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
365
363
  [CLI usage](https://docs.generate-ip.org/#-command-line-usage) /
366
364
  [Discuss](https://github.com/adamlui/js-utils/discussions)
367
365
 
368
- ### <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) &nbsp;<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>
366
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d3424a/geolocate/assets/images/icons/wire-globe/white/icon32.png"><img height=22 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d3424a/geolocate/assets/images/icons/wire-globe/black/icon32.png"></picture> [geolocate](https://js-utils.org/geolocate) &nbsp;<a href="https://github.com/toolleeo/cli-apps/#networking"><img height=18 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/badges/awesome/badge.svg"></a>
369
367
 
370
368
  > Fetch IP geolocation data from the CLI.
371
369
  <br>[Install](https://docs.geolocatejs.org/#-installation) /
@@ -376,8 +374,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
376
374
 
377
375
  <br>
378
376
 
379
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
377
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
380
378
 
381
- <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> /
379
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/home/white/icon32x27.png"><img height=13 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/home/dark-gray/icon32x27.png"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
382
380
  <a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
383
381
  <a href="#top">Back to top ↑</a>
package/dist/cli/index.js CHANGED
@@ -3,18 +3,14 @@
3
3
  (async () => {
4
4
  'use strict'
5
5
 
6
- globalThis.env = {
7
- args: process.argv.slice(2),
8
- modes: { dev: /[\\/]src(?:[\\/]|$)/i.test(__dirname) },
9
- paths: { lib: './lib' }
10
- }
11
- env.modes.debug = env.args.some(arg => /^--?(?:V|debug(?:[-_]?mode)?)$/.test(arg))
6
+ // Init ENV
7
+ const init = require('./lib/init')
8
+ init.env()
12
9
 
13
10
  // Import LIBS
14
- globalThis.log = require(`${env.paths.lib}/log`)
11
+ globalThis.log = require('./lib/log')
15
12
  const clipboardy = require('node-clipboardy'),
16
- { generatePassword } = require(`../generate-pw${ env.modes.dev ? '' : '.min' }.js`),
17
- init = require(`${env.paths.lib}/init`)
13
+ { generatePassword } = require(`../generate-pw${ env.modes.dev ? '' : '.min' }.js`)
18
14
 
19
15
  await init.cli()
20
16
 
@@ -1,12 +1,10 @@
1
1
  const language = require('./language'),
2
2
  settings = require('./settings')
3
3
 
4
- const dataPath = `../../${ env.modes.dev ? '../' : 'data/' }`
5
-
6
4
  module.exports = {
7
5
 
8
6
  async cli() {
9
- Object.assign(globalThis.cli ??= {}, require(`${dataPath}package-data.json`))
7
+ Object.assign(globalThis.cli ??= {}, require(`${env.paths.libData}/package-data.json`))
10
8
  cli.msgs = await language.getMsgs('en')
11
9
  cli.msgs = await language.getMsgs(cli.lang = settings.load('uiLang') || (
12
10
  env.modes.debug ? language.generateRandomLang({ excludes: ['en'] }) : language.getSysLang() ))
@@ -27,11 +25,11 @@ module.exports = {
27
25
 
28
26
  if (fs.existsSync(paths.target)) // use existing config file
29
27
  return log.warn(`${cli.msgs.warn_configFileExists}:`, paths.target)
30
- if (fs.existsSync(paths.src = path.resolve(__dirname, `${dataPath}${filename}`)))
28
+ if (fs.existsSync(paths.src = path.resolve(__dirname, `${env.paths.libData}/${filename}`)))
31
29
  fs.copyFileSync(paths.src, paths.target) // use found template
32
30
 
33
31
  else { // use jsDelivr copy
34
- const jsdURL = `${require('./jsdelivr').pkgVerURL()}/${filename}`
32
+ const jsdURL = `${require('./jsdelivr').getPkgVerURL()}/${filename}`
35
33
  log.data(`${cli.msgs.info_fetchingRemoteConfigFrom} ${jsdURL}...`)
36
34
  try {
37
35
  const data = require('./data'),
@@ -45,5 +43,15 @@ module.exports = {
45
43
  log.success(`${cli.msgs.info_configFileCreated}: ${paths.target}\n`)
46
44
  log.tip(`${cli.msgs.tip_editToSetDefaults}.`)
47
45
  log.tip(`${cli.msgs.tip_cliArgsPrioritized}.`)
46
+ },
47
+
48
+ env() {
49
+ Object.assign(globalThis.env ??= {}, {
50
+ args: process.argv.slice(2),
51
+ modes: { dev: /[\\/]src(?:[\\/]|$)/i.test(__dirname) },
52
+ supports: { unicode: require('is-unicode-supported').default() }
53
+ })
54
+ env.modes.debug = env.args.some(arg => /^--?(?:V|debug(?:[-_]?mode)?)$/.test(arg))
55
+ env.paths = { libData: `../../${ env.modes.dev ? '..' : 'data' }` }
48
56
  }
49
57
  }
@@ -1,10 +1,10 @@
1
1
  module.exports = {
2
2
 
3
- pkgVerURL(version) {
3
+ getPkgVerURL(version) {
4
4
  version ||= cli.version ||= require('./pkg').getVer('local') || 'none'
5
5
  const verTag = !/^\d+\.\d+\.\d+$/.test(version) ? 'latest' : `${cli.name}-${version}`
6
6
  return `${cli.urls.jsdelivr}@${verTag}/${cli.name}`
7
7
  },
8
8
 
9
- commitURL(hash = 'latest') { return `${cli.urls.jsdelivr}@${hash}/${cli.name}` }
9
+ getCommitURL(hash = 'latest') { return `${cli.urls.jsdelivr}@${hash}/${cli.name}` }
10
10
  }
@@ -8,7 +8,7 @@ module.exports = {
8
8
 
9
9
  async getDocLocales() {
10
10
  cli.version ||= require('./pkg').getVer('local') || 'none'
11
- const jsdURL = `${require('./jsdelivr').pkgVerURL()}/docs/`,
11
+ const jsdURL = `${require('./jsdelivr').getPkgVerURL()}/docs/`,
12
12
  locales = []
13
13
  try {
14
14
  const respText = await (await data.fetch(jsdURL)).text(),
@@ -27,13 +27,13 @@ module.exports = {
27
27
  let locales = includes.length ? includes : (() => {
28
28
 
29
29
  // Read cache if found
30
- const cacheDir = path.join(__dirname, '..', '.cache'),
30
+ const cacheDir = path.join(__dirname, '../../.cache'),
31
31
  localeCache = path.join(cacheDir, 'locales.json')
32
32
  if (fs.existsSync(localeCache))
33
33
  try { return JSON.parse(fs.readFileSync(localeCache, 'utf8')) } catch (err) {}
34
34
 
35
35
  // Discover pkg _locales
36
- const localesDir = path.resolve(process.cwd(), '_locales')
36
+ const localesDir = path.resolve(__dirname, '../../../_locales')
37
37
  if (!fs.existsSync(localesDir)) return ['en']
38
38
  const locales = fs.readdirSync(localesDir, { withFileTypes: true })
39
39
  .filter(entry => entry.isDirectory()).map(entry => entry.name)
@@ -51,9 +51,7 @@ module.exports = {
51
51
  locales = locales.filter(locale => !excludeSet.has(locale))
52
52
 
53
53
  // Get random language
54
- let randomLang = 'en'
55
- if (locales.length)
56
- randomLang = locales[Math.floor(Math.random() * locales.length)]
54
+ const randomLang = locales.length ? locales[Math.floor(Math.random() * locales.length)] : 'en'
57
55
  log.debug(`Random language: ${randomLang}`)
58
56
 
59
57
  return randomLang
@@ -64,20 +62,29 @@ module.exports = {
64
62
  if (env.msgs && langCode == cli.lang) return env.msgs // don't re-fetch same msgs
65
63
 
66
64
  let msgs = data.flatten( // local ones
67
- require(`../../${ env.modes.dev ? '../_locales/en/' : 'data/' }messages.json`))
65
+ require(`../../${ env.modes.dev ? '../_locales/en' : 'data' }/messages.json`))
68
66
 
69
67
  if (!langCode.startsWith('en')) { // fetch non-English msgs from jsDelivr
70
- const msgHostURL = `${require('./jsdelivr').commitURL(cli.commitHashes.locales)}/_locales/`
71
- let msgHref = `${msgHostURL}${langCode}/messages.json`, msgFetchesTried = 0
68
+ try { // check if terminal supports non-Latin scripts
69
+ const nonLatinLocales = await (await data.fetch(
70
+ `${cli.urls.jsdelivr}@${cli.commitHashes.data}/assets/data/non-latin-locales.json`
71
+ )).json()
72
+ if (nonLatinLocales.includes(langCode.split('-')[0]) && !env.supports.unicode)
73
+ return msgs // en ones
74
+ } catch (err) {
75
+ log.debug(`Failed to fetch non-Latin locales: ${err}`)
76
+ }
77
+ const msgBaseURL = `${require('./jsdelivr').getCommitURL(cli.commitHashes.locales)}/_locales`
78
+ let msgURL = `${msgBaseURL}/${langCode}/messages.json`, msgFetchesTried = 0
72
79
  while (msgFetchesTried < 3)
73
80
  try { // fetch remote msgs
74
- msgs = data.flatten(await (await data.fetch(msgHref)).json())
81
+ msgs = data.flatten(await (await data.fetch(msgURL)).json())
75
82
  break
76
83
  } catch (err) { // retry up to 2X (region-stripped + EN)
77
84
  msgFetchesTried++ ; if (msgFetchesTried >= 3) break
78
- log.debug(msgHref = langCode.includes('-') && msgFetchesTried == 1 ?
79
- msgHref.replace(/([^_]*)_[^/]*(\/.*)/, '$1$2') // strip region before retrying
80
- : `${msgHostURL}en/messages.json` // else use EN msgs
85
+ log.debug(msgURL = langCode.includes('-') && msgFetchesTried == 1 ?
86
+ msgURL.replace(/([^_]*)_[^/]*(\/.*)/, '$1$2') // strip region before retrying
87
+ : `${msgBaseURL}/en/messages.json` // else use EN msgs
81
88
  )
82
89
  }
83
90
  }
@@ -1,5 +1,6 @@
1
1
  const colors = require('./color'),
2
2
  { getDownloads, getVer } = require('./pkg'),
3
+ settings = require('./settings'),
3
4
  string = require('./string')
4
5
 
5
6
  const nextMajVer = require('../../../package.json').version.replace(/^(\d+)\..*/, (_, major) => `${ +major +1 }.0.0`)
@@ -7,6 +8,7 @@ const nextMajVer = require('../../../package.json').version.replace(/^(\d+)\..*/
7
8
  module.exports = {
8
9
  colors,
9
10
 
11
+ break() { console.log() },
10
12
  configURL() { this.info(`${cli.msgs.info_exampleValidConfigFile}: ${cli.urls.config}`) },
11
13
  configURLandExit(...args) { this.error(...args); this.configURL(); process.exit(1) },
12
14
  data(msg) { console.log(`\n${colors.bw}${msg}${colors.nc}`) },
@@ -15,9 +17,8 @@ module.exports = {
15
17
  errorAndExit(...args) { this.error(...args); this.helpDocsCmdsDocsURL(); process.exit(1) },
16
18
  ifNotQuiet(msg) { if (!cli.config.quietMode) this.info(msg) },
17
19
  info(msg) { console.info(`\n${colors.schemes.default[0]}${msg}${colors.nc}`) },
18
- break() { console.log() },
19
- tip(msg) { console.info(`${colors.by}TIP: ${msg}${colors.nc}`) },
20
20
  success(msg) { console.log(`\n${colors.bg}${msg}${colors.nc}`) },
21
+ tip(msg) { console.info(`${colors.by}TIP: ${msg}${colors.nc}`) },
21
22
  warn(...args) { console.warn(`\n${colors.bo}WARNING:`, ...args, colors.nc) },
22
23
 
23
24
  argDoesNothing(arg) {
@@ -30,11 +31,10 @@ module.exports = {
30
31
  this.warn(
31
32
  `${cli.msgs.info_configFile} ${cli.msgs.warn_option.toLowerCase()} '${oldKey}: ${oldVal}' ${
32
33
  cli.msgs.warn_hasBeenReplacedBy} '${
33
- newKey}: ${ isNegKey(oldKey) != isNegKey(newKey) ? !oldVal : oldVal }' ${
34
+ newKey}: ${ settings.isNegKey(oldKey) != settings.isNegKey(newKey) ? !oldVal : oldVal }' ${
34
35
  cli.msgs.warn_andWillBeRemoved} @ v${nextMajVer}`
35
36
  )
36
37
  this[`${oldKey}Warned`] = true
37
- function isNegKey(key) { return /^(?:no|disable|exclude)[A-Z]/.test(key) }
38
38
  }
39
39
  },
40
40
 
@@ -35,15 +35,17 @@ module.exports = {
35
35
  help: { type: 'cmd', regex: /^--?h(?:elp)?$/ },
36
36
  version: { type: 'cmd', regex: /^--?ve?r?s?i?o?n?$/ },
37
37
  stats: { type: 'cmd', regex: /^--?stats?$/ },
38
- entropy: { type: 'legacy', replacedBy: 'noEntropy', regex: /^--?e(?:ntropy)?$/ }
38
+ legacy_entropy: { type: 'flag', replacedBy: 'noEntropy', regex: /^--?e(?:ntropy)?$/ }
39
39
  },
40
40
 
41
+ isNegKey(key) { return /^(?:no|disable|exclude)[A-Z]/.test(key) },
42
+
41
43
  load(ctrlKeys = Object.keys(this.controls)) {
42
44
  const inputCtrlKeys = [].concat(ctrlKeys) // force array
43
45
 
44
46
  if (!cli.defaultsSet && !arguments.length) { // init all defaults on arg-less load()
45
47
  inputCtrlKeys.forEach(key => {
46
- const ctrl = this.controls[key] ; if (ctrl.mode || ctrl.type == 'legacy') return
48
+ const ctrl = this.controls[key] ; if (ctrl.mode || key.startsWith('legacy_')) return
47
49
  cli.config[key] ??= ctrl.defaultVal ?? ( ctrl.type == 'param' ? '' : false )
48
50
  })
49
51
  cli.defaultsSet = true
@@ -82,8 +84,8 @@ module.exports = {
82
84
  if (this.configFileKeyWhitelist && !this.configFileKeyWhitelist.includes(key))
83
85
  log.invalidConfigKey(key)
84
86
  return
85
- } else if (ctrl.type == 'legacy' && ctrl.replacedBy) {
86
- if (key.toLowerCase().includes('no') != ctrl.replacedBy.toLowerCase().includes('no'))
87
+ } else if (key.startsWith('legacy_') && ctrl.replacedBy) {
88
+ if (this.isNegKey(key) != this.isNegKey(ctrl.replacedBy))
87
89
  cli.config[ctrl.replacedBy] = !val // assign opposite val to current key
88
90
  else // assign direct val to current key
89
91
  cli.config[ctrl.replacedBy] = val
@@ -101,8 +103,8 @@ module.exports = {
101
103
  const ctrlKey = Object.keys(this.controls).find(key => this.controls[key]?.regex?.test(arg))
102
104
  if (!ctrlKey && cli.msgs) log.errorAndExit(`[${arg}] ${cli.msgs.error_notRecognized}.`)
103
105
  if (!inputCtrlKeys.includes(ctrlKey)) return // don't process env.args when load() specific keys
106
+ if (ctrlKey.startsWith('legacy_')) { log.argDoesNothing(arg) ; continue }
104
107
  const ctrl = this.controls[ctrlKey]
105
- if (ctrl.type == 'legacy') { log.argDoesNothing(arg) ; continue }
106
108
  if (ctrl.mode) // set cli.config.mode to mode name
107
109
  cli.config.mode = ctrlKey.replace(/mode$/i, '').toLowerCase()
108
110
  else { // init flag/param/cmd cli.config[ctrlKey] val
@@ -13,6 +13,7 @@
13
13
  "src": "https://github.com/adamlui/js-utils/tree/main/generate-pw/src"
14
14
  },
15
15
  "commitHashes": {
16
- "locales": "78c0809"
16
+ "data": "e7b36d1",
17
+ "locales": "b93ea3a"
17
18
  }
18
19
  }
package/docs/README.md CHANGED
@@ -3,17 +3,17 @@
3
3
  <div align="right">
4
4
  <h6>
5
5
  <picture>
6
- <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/earth/white/icon32.svg?v=7c33be0">
7
- <img height=14 src="https://assets.js-utils.org/images/icons/earth/black/icon32.svg?v=7c33be0">
6
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@f2dc346/assets/images/icons/earth/white/icon32.svg">
7
+ <img height=14 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@f2dc346/assets/images/icons/earth/black/icon32.svg">
8
8
  </picture>
9
9
  &nbsp;English |
10
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-cn#readme">简体中文</a> |
11
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-tw#readme">繁體中文</a> |
12
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/hi#readme">हिंदी</a> |
13
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/bn#readme">বাংলা</a> |
14
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/de#readme">Deutsch</a> |
15
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/es#readme">Español</a> |
16
- <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/fr#readme">Français</a>
10
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-cn/#readme">简体中文</a> |
11
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/zh-tw/#readme">繁體中文</a> |
12
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/hi/#readme">हिंदी</a> |
13
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/bn/#readme">বাংলা</a> |
14
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/de/#readme">Deutsch</a> |
15
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/es/#readme">Español</a> |
16
+ <a href="https://github.com/adamlui/js-utils/tree/main/generate-pw/docs/fr/#readme">Français</a>
17
17
  </h6>
18
18
  </div>
19
19
 
@@ -21,24 +21,22 @@
21
21
 
22
22
  ### Randomly generate, strengthen, and validate cryptographically-secure passwords.
23
23
 
24
- <a href="https://www.npmjs.com/package/generate-pw">
24
+ <a href="https://npmstar.com/compare/generate-pw">
25
25
  <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>
26
26
  <a href="#%EF%B8%8F-mit-license">
27
27
  <img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
28
- <a href="https://github.com/adamlui/js-utils/releases/tag/generate-pw-2.2.0">
29
- <img height=31 src="https://img.shields.io/badge/Latest_Build-2.2.0-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
28
+ <a href="https://github.com/adamlui/js-utils/releases/tag/generate-pw-2.3.1">
29
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.3.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
30
30
  <a href="https://www.npmjs.com/package/generate-pw?activeTab=code">
31
31
  <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>
32
- <a href="#">
33
- <img height=31 src="https://img.shields.io/bundlejs/size/generate-pw%402.1.2?label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
34
32
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-pw/src/generate-pw.js">
35
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>
36
- <a href="https://github.com/toolleeo/cli-apps#password-managers">
34
+ <a href="https://github.com/toolleeo/cli-apps/#password-managers">
37
35
  <img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-ff69b4?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
38
36
 
39
37
  <br>
40
38
 
41
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
39
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
42
40
 
43
41
  ## 💡 About
44
42
 
@@ -49,7 +47,7 @@
49
47
  - **Multi-environment support —** Use in Node.js or the web browser
50
48
  - **Command line usable —** Just type `generate-pw`, that's it
51
49
 
52
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
50
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
53
51
 
54
52
  ## ⚡ Installation
55
53
 
@@ -67,13 +65,13 @@ $ npm install generate-pw
67
65
 
68
66
  <br>
69
67
 
70
- <a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
68
+ <a href="https://github.com/sponsors/adamlui"><img src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/banners/sponsor/$10/banner1660x260.png"></a>
71
69
 
72
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
70
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
73
71
 
74
72
  ## 🔌 Importing the API
75
73
 
76
- ### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
74
+ ### <img height=18 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/node.js/icon25x28.png"> Node.js
77
75
 
78
76
  #### ECMAScript*:
79
77
 
@@ -89,28 +87,28 @@ const pw = require('generate-pw')
89
87
 
90
88
  ###### _*Node.js version 14 or higher required_
91
89
 
92
- ### <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
90
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/web/light/icon25.png"><img width=16 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/web/dark/icon25.png"></picture> Web
93
91
 
94
92
  #### <> HTML script tag:
95
93
 
96
94
  ```html
97
- <script src="https://cdn.jsdelivr.net/npm/generate-pw@2.2.0/dist/generate-pw.min.js"></script>
95
+ <script src="https://cdn.jsdelivr.net/npm/generate-pw@2.3.1/dist/generate-pw.min.js"></script>
98
96
  ```
99
97
 
100
98
  #### ES6:
101
99
 
102
100
  ```js
103
101
  (async () => {
104
- await import('https://cdn.jsdelivr.net/npm/generate-pw@2.2.0/dist/generate-pw.min.js')
102
+ await import('https://cdn.jsdelivr.net/npm/generate-pw@2.3.1/dist/generate-pw.min.js')
105
103
  // Your code here...
106
104
  })()
107
105
  ```
108
106
 
109
- ### <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
107
+ ### <img height=17 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/tampermonkey/icon28.png"><img height=17.5 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/platforms/violentmonkey/icon25.png"> Greasemonkey
110
108
 
111
109
  ```js
112
110
  ...
113
- // @require https://cdn.jsdelivr.net/npm/generate-pw@2.2.0/dist/generate-pw.min.js
111
+ // @require https://cdn.jsdelivr.net/npm/generate-pw@2.3.1/dist/generate-pw.min.js
114
112
  // ==/UserScript==
115
113
 
116
114
  // Your code here...
@@ -118,11 +116,11 @@ const pw = require('generate-pw')
118
116
 
119
117
  <br>
120
118
 
121
- **💡 Note:** To always import the latest version (not recommended in production!) remove the `@2.2.0` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-pw/dist/generate-pw.min.js`
119
+ **💡 Note:** To always import the latest version (not recommended in production!) remove the `@2.3.1` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-pw/dist/generate-pw.min.js`
122
120
 
123
121
  <br>
124
122
 
125
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
123
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
126
124
 
127
125
  ## 📋 API usage
128
126
 
@@ -261,17 +259,17 @@ Name | Type | Description
261
259
 
262
260
  <br>
263
261
 
264
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
262
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
265
263
 
266
264
  ## 💻 Command line usage
267
265
 
268
- When installed [globally](#-installation), **generate-pw** can also be used from the command line. The basic command is:
266
+ **generate-pw** can also be used directly from the command line. The basic command is:
269
267
 
270
268
  ```
271
269
  $ generate-pw
272
270
  ```
273
271
 
274
- <img src="https://media.generatepw.org/images/screenshots/cli/generate-pw-cmd-output.png?0d36e26">
272
+ <img src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d3424a/generate-pw/assets/images/screenshots/cli/generate-pw-cmd-output.png">
275
273
 
276
274
  #
277
275
 
@@ -338,7 +336,7 @@ export default {
338
336
 
339
337
  <br>
340
338
 
341
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
339
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
342
340
 
343
341
  ## 🏛️ MIT License
344
342
 
@@ -352,11 +350,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
352
350
 
353
351
  <br>
354
352
 
355
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
353
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
356
354
 
357
355
  ## 🛠️ Related utilities
358
356
 
359
- ### <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) &nbsp;<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>
357
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@5c34563/generate-ip/assets/images/icons/node-graph/white/icon55x49.png"><img height=21 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@5c34563/generate-ip/assets/images/icons/node-graph/black/icon55x49.png"></picture> [generate-ip](https://js-utils.org/generate-ip) &nbsp;<a href="https://github.com/toolleeo/cli-apps/#networking"><img height=18 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/badges/awesome/badge.svg"></a>
360
358
 
361
359
  > Randomly generate, format, and validate IPv4 + IPv6 + MAC addresses.
362
360
  <br>[Install](https://docs.generate-ip.org/#-installation) /
@@ -365,7 +363,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
365
363
  [CLI usage](https://docs.generate-ip.org/#-command-line-usage) /
366
364
  [Discuss](https://github.com/adamlui/js-utils/discussions)
367
365
 
368
- ### <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) &nbsp;<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>
366
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d3424a/geolocate/assets/images/icons/wire-globe/white/icon32.png"><img height=22 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d3424a/geolocate/assets/images/icons/wire-globe/black/icon32.png"></picture> [geolocate](https://js-utils.org/geolocate) &nbsp;<a href="https://github.com/toolleeo/cli-apps/#networking"><img height=18 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/badges/awesome/badge.svg"></a>
369
367
 
370
368
  > Fetch IP geolocation data from the CLI.
371
369
  <br>[Install](https://docs.geolocatejs.org/#-installation) /
@@ -376,8 +374,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
376
374
 
377
375
  <br>
378
376
 
379
- <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
377
+ <img height=6px width="100%" src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/separators/aqua-gradient.png">
380
378
 
381
- <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> /
379
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/home/white/icon32x27.png"><img height=13 src="https://cdn.jsdelivr.net/gh/adamlui/js-utils@0d36e26/assets/images/icons/home/dark-gray/icon32x27.png"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
382
380
  <a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
383
381
  <a href="#top">Back to top ↑</a>
package/docs/SECURITY.md CHANGED
@@ -17,4 +17,4 @@
17
17
 
18
18
  # 🛡️ Security Policy
19
19
 
20
- If you find a vulnerability, please follow the reporting instructions @ https://tidelift.com/security
20
+ If you find a vulnerability, please e-mail security@tidelift.com and a fix will be coordinated within 2 business days.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generate-pw",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "Randomly generate, strengthen, and validate cryptographically-secure passwords.",
5
5
  "author": {
6
6
  "name": "Adam Lui",
@@ -34,8 +34,10 @@
34
34
  "!docs/*/"
35
35
  ],
36
36
  "bin": {
37
+ "generate-pw": "dist/cli/index.js",
37
38
  "generatepw": "dist/cli/index.js",
38
- "generate-pw": "dist/cli/index.js"
39
+ "gen-pw": "dist/cli/index.js",
40
+ "genpw": "dist/cli/index.js"
39
41
  },
40
42
  "directories": {
41
43
  "lib": "./dist",
@@ -74,10 +76,11 @@
74
76
  "url": "https://github.com/adamlui/js-utils/issues"
75
77
  },
76
78
  "dependencies": {
79
+ "is-unicode-supported": "^2.1.0",
77
80
  "node-clipboardy": "^1.0.3"
78
81
  },
79
82
  "devDependencies": {
80
- "@adamlui/minify.js": "^2.3.1",
83
+ "@adamlui/minify.js": "^2.5.0",
81
84
  "console-table-printer": "^2.15.0",
82
85
  "copyfiles": "^2.4.1"
83
86
  }