@adamlui/minify.js 1.5.8 → 1.6.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
@@ -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://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/white/icon32.svg">
5
- <img height=14 src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/black/icon32.svg">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.minify-js.org/images/icons/earth/white/icon32.svg?d07ee82">
5
+ <img height=14 src="https://media.minify-js.org/images/icons/earth/black/icon32.svg?d07ee82">
6
6
  </picture>
7
7
  &nbsp;English |
8
8
  <a href="https://github.minify-js.org/tree/main/node.js/docs/zh-cn/#readme">简体中文</a> |
@@ -23,17 +23,17 @@
23
23
 
24
24
  <a href="https://www.npmjs.com/package/@adamlui/minify.js"><img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fminify.js?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
25
25
  <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
- <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.5.8"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.5.8-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
+ <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.6.1"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.6.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
27
27
  <a href="https://www.npmjs.com/package/@adamlui/minify.js?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fminify.js?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
28
28
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_minify.js:node.js/src/minify.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_minify.js%3Anode.js%2Fsrc%2Fminify.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
29
29
  <a href="https://github.com/toolleeo/cli-apps#programming"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
30
30
  <a href="https://minify-js.org"><img height=31 src="https://img.shields.io/badge/web-minify--js.org-lightgrey?logo=dribbble&logoColor=white&labelColor=464646&style=for-the-badge"></a>
31
31
 
32
- <img src="https://raw.githubusercontent.com/adamlui/minify.js/main/node.js/media/images/screenshots/cli-minify-js-docs.png">
32
+ <img src="https://cdn.jsdelivr.net/gh/adamlui/minify.js@3d56890/node.js/media/images/screenshots/cli/minify-js-docs-cmd-output.png">
33
33
 
34
34
  <br>
35
35
 
36
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
36
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
37
37
 
38
38
  ## ⚡ Installation
39
39
 
@@ -57,7 +57,7 @@ $ npm install @adamlui/minify.js
57
57
 
58
58
  <br>
59
59
 
60
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
60
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
61
61
 
62
62
  ## 💻 Command line usage
63
63
 
@@ -128,26 +128,27 @@ $ minify-js input_folder output_folder
128
128
 
129
129
  ```
130
130
  Boolean options:
131
- -n, --dry-run Don't actually minify the file(s), just show
132
- if they will be processed.
133
- -d, --include-dotfolders Include dotfolders in file search.
134
- -D, --include-dotfiles Include dotfiles in file search.
135
- -R, --no-recursion Disable recursive file searching.
136
- -M, --no-mangle Disable mangling names.
137
- -q, --quiet Suppress all logging except errors.
131
+ -n, --dry-run Don't actually minify the file(s),
132
+ just show if they will be processed.
133
+ -d, --include-dotfolders Include dotfolders in file search.
134
+ -D, --include-dotfiles Include dotfiles in file search.
135
+ -R, --no-recursion Disable recursive file searching.
136
+ -M, --no-mangle Disable mangling names.
137
+ -q, --quiet Suppress all logging except errors.
138
138
 
139
139
  Parameter options:
140
- --comment="comment" Prepend comment to minified code. Separate
141
- by line using '\n'.
140
+ --ignore-files="file1.js,file2.js" Files to exclude from minification.
141
+ --comment="comment" Prepend comment to minified code.
142
+ Separate by line using '\n'.
142
143
 
143
144
  Info commands:
144
- -h, --help Display help screen.
145
- -v, --version Show version number.
145
+ -h, --help Display help screen.
146
+ -v, --version Show version number.
146
147
  ```
147
148
 
148
149
  <br>
149
150
 
150
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
151
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
151
152
 
152
153
  ## 🔌 API usage
153
154
 
@@ -205,14 +206,15 @@ minifyJS.minify(input, { dotFiles: true });
205
206
 
206
207
  Available parameters (and their default settings) are:
207
208
 
208
- Name | Type | Desciption | Default value
209
- -------------|---------|-------------------------------------------------------------------|---------------
210
- `recursive` | Boolean | Recursively search for nested files if dir path passed. | `true`
211
- `verbose` | Boolean | Show logging in console/terminal. | `true`
212
- `dotFolders` | Boolean | Include dotfolders in file search. | `false`
213
- `dotFiles` | Boolean | Include dotfiles in file search. | `false`
214
- `mangle` | Boolean | Shorten variable names (typically to one character). | `true`
215
- `comment` | String | Comment to prepend to minified code. Separate by line using '\n'. | `''`
209
+ Name | Type | Desciption | Default value
210
+ --------------|---------|-------------------------------------------------------------------|---------------
211
+ `recursive` | Boolean | Recursively search for nested files if dir path passed. | `true`
212
+ `verbose` | Boolean | Show logging in console/terminal. | `true`
213
+ `dotFolders` | Boolean | Include dotfolders in file search. | `false`
214
+ `dotFiles` | Boolean | Include dotfiles in file search. | `false`
215
+ `mangle` | Boolean | Shorten variable names (typically to one character). | `true`
216
+ `ignoreFiles` | Array | Files (by name) to exclude from minification. | `[]`
217
+ `comment` | String | Comment to prepend to minified code. Separate by line using '\n'. | `''`
216
218
 
217
219
  #
218
220
 
@@ -241,16 +243,17 @@ findJS() » Check returned array.
241
243
 
242
244
  Available parameters (and their default settings) are:
243
245
 
244
- Name | Type | Desciption | Default value
245
- -------------|---------|----------------------------------------------------------|---------------
246
- `recursive` | Boolean | Recursively search for nested files in searchDir passed. | `true`
247
- `verbose` | Boolean | Show logging in console/terminal. | `true`
248
- `dotFolders` | Boolean | Include dotfolders in file search. | `false`
249
- `dotFiles` | Boolean | Include dotfiles in file search. | `false`
246
+ Name | Type | Desciption | Default value
247
+ --------------|---------|----------------------------------------------------------|---------------
248
+ `recursive` | Boolean | Recursively search for nested files in searchDir passed. | `true`
249
+ `verbose` | Boolean | Show logging in console/terminal. | `true`
250
+ `dotFolders` | Boolean | Include dotfolders in file search. | `false`
251
+ `dotFiles` | Boolean | Include dotfiles in file search. | `false`
252
+ `ignoreFiles` | Array | Files (by name) to exclude from search results. | `[]`
250
253
 
251
254
  <br>
252
255
 
253
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
256
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
254
257
 
255
258
  ## 🏛️ MIT License
256
259
 
@@ -264,30 +267,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
264
267
 
265
268
  <br>
266
269
 
267
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
270
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
268
271
 
269
272
  ## 🛠️ Related utilities
270
273
 
271
- ### [</> minify.js (Gulp)](https://gulp.minify-js.org) <a href="https://github.com/toolleeo/cli-apps#programming"><img height=18 src="https://awesome.re/mentioned-badge.svg"></a>
274
+ ### [</> minify.js (Gulp)](https://gulp.minify-js.org) <a href="https://github.com/toolleeo/cli-apps#programming"><img height=18 src="https://media.minify-js.org/images/badges/awesome/badge.svg?b78dcd3"></a>
272
275
 
273
276
  > Gulp plug-in to recursively minify all JavaScript files.
274
277
  <br>[Install](https://gulp.minify-js.org/#-installation) /
275
278
  [Readme](https://gulp.minify-js.org/#readme) /
276
279
  [Discuss](https://github.minify-js.org/discussions)
277
280
 
278
- ### [{ } scss-to-css](https://github.com/adamlui/scss-to-css) <a href="https://github.com/toolleeo/cli-apps#conversion"><img height=18 src="https://awesome.re/mentioned-badge.svg"></a>
281
+ ### [{ } scss-to-css](https://github.com/adamlui/scss-to-css) <a href="https://github.com/toolleeo/cli-apps#conversion"><img height=18 src="https://media.minify-js.org/images/badges/awesome/badge.svg?b78dcd3"></a>
279
282
 
280
283
  > Recursively compile all SCSS files into minified CSS.
281
- <br>[Install](https://github.com/adamlui/scss-to-css/#-installation) /
282
- [Readme](https://github.com/adamlui/scss-to-css/#readme) /
283
- [CLI usage](https://github.com/adamlui/scss-to-css/#-command-line-usage) /
284
- [API usage](https://github.com/adamlui/scss-to-css/#-api-usage) /
285
- [Discuss](https://github.com/adamlui/scss-to-css/discussions)
284
+ <br>[Install](https://node.scsstocss.org/#-installation) /
285
+ [Readme](https://node.scsstocss.org/#readme) /
286
+ [CLI usage](https://node.scsstocss.org/#-command-line-usage) /
287
+ [API usage](https://node.scsstocss.org/#-api-usage) /
288
+ [Discuss](https://github.scsstocss.org/discussions)
286
289
 
287
290
  <br>
288
291
 
289
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
292
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
290
293
 
291
- <picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/adamlui/js-utils/main/media/images/icons/home/white/icon32x27.png"><img height=13 src="https://raw.githubusercontent.com/adamlui/js-utils/main/media/images/icons/home/dark-gray/icon32x27.png"></picture> <a href="https://js-utils.com">**More JavaScript utilities**</a> /
294
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.minify-js.org/images/icons/home/white/icon32x27.png?d07ee82"><img height=13 src="https://media.minify-js.org/images/icons/home/dark-gray/icon32x27.png?d07ee82"></picture> <a href="https://js-utils.com">**More JavaScript utilities**</a> /
292
295
  <a href="https://github.minify-js.org/discussions">Discuss</a> /
293
296
  <a href="#-minifyjs">Back to top ↑</a>
package/dist/cli.min.js CHANGED
@@ -4,25 +4,25 @@
4
4
  * Source: https://code.minify-js.org/node.js
5
5
  * Documentation: https://docs.minify-js.org/node.js
6
6
  */
7
- const pkgName="@adamlui/minify.js",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="minify-js [inputPath] [outputPath] [options]",srcURL="https://code.minify-js.org/node.js",docURL="https://docs.minify-js.org/node.js/#-command-line-usage",minifyJS=require(__dirname.match(/src/)?"./minify":"./minify.min"),fs=require("fs"),path=require("path"),execSync=require("child_process")["execSync"],nc="",br="",by="",bg="",bw="",config={},reArgs={flags:{dryRun:/^--?(?:n|dry-?run)$/,includeDotFolders:/^--?(?:dd?|(?:include-?)?dot-?(?:folder|dir(?:ector(?:y|ie))?)s?=?(?:true|1)?)$/,includeDotFiles:/^--?(?:df|D|(?:include-?)?dot-?files?=?(?:true|1)?)$/,noRecursion:/^--?(?:R|(?:disable|no)-?recursi(?:on|ve)|recursi(?:on|ve)=(?:false|0))$/,noMangle:/^--?(?:M|(?:disable|no)-?mangle|mangle=(?:false|0))$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},paramOptions:{comment:/^--?comments?(?:=.*|$)/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};if(process.argv.forEach(n=>{var e,i,o;n.startsWith("-")&&(e=Object.keys(reArgs.paramOptions).find(e=>reArgs.paramOptions[e].test(n)),o=Object.keys(reArgs.flags).find(e=>reArgs.flags[e].test(n)),i=Object.keys(reArgs.infoCmds).find(e=>reArgs.infoCmds[e].test(n)),o?config[o]=!0:e?(n.includes("=")||(console.error(`
8
- ${br}ERROR: Arg [--${n.replace(/-/g,"")}] requires '=' followed by a value.`+nc),printHelpCmdAndDocURL(),process.exit(1)),o=n.split("=")[1],config[e]=parseInt(o)||o):i||(console.error(`
9
- ${br}ERROR: Arg [${n}] not recognized.`+nc),console.info(`
7
+ const pkgName="@adamlui/minify.js",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="minify-js [inputPath] [outputPath] [options]",srcURL="https://code.minify-js.org/node.js",docURL="https://docs.minify-js.org/node.js/#-command-line-usage",minifyJS=require(__dirname.match(/src/)?"./minify":"./minify.min"),fs=require("fs"),path=require("path"),execSync=require("child_process")["execSync"],nc="",br="",by="",bg="",bw="",config={},reArgs={flags:{dryRun:/^--?(?:n|dry-?run)$/,includeDotFolders:/^--?(?:dd?|(?:include-?)?dot-?(?:folder|dir(?:ector(?:y|ie))?)s?=?(?:true|1)?)$/,includeDotFiles:/^--?(?:df|D|(?:include-?)?dot-?files?=?(?:true|1)?)$/,noRecursion:/^--?(?:R|(?:disable|no)-?recursi(?:on|ve)|recursi(?:on|ve)=(?:false|0))$/,noMangle:/^--?(?:M|(?:disable|no)-?mangle|mangle=(?:false|0))$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},paramOptions:{ignoreFiles:/^--?(?:ignore|skip|exclude)(?:d?-?files?)?(?:=.*|$)/,comment:/^--?comments?(?:=.*|$)/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};if(process.argv.forEach(i=>{var e,n,o;i.startsWith("-")&&(o=Object.keys(reArgs.flags).find(e=>reArgs.flags[e].test(i)),e=Object.keys(reArgs.paramOptions).find(e=>reArgs.paramOptions[e].test(i)),n=Object.keys(reArgs.infoCmds).find(e=>reArgs.infoCmds[e].test(i)),o?config[o]=!0:e?(/=.+/.test(i)||(console.error(`
8
+ ${br}ERROR: Arg [--${i.replace(/-/g,"")}] requires '=' followed by a value.`+nc),printHelpCmdAndDocURL(),process.exit(1)),o=i.split("=")[1],config[e]=parseInt(o)||o):n||(console.error(`
9
+ ${br}ERROR: Arg [${i}] not recognized.`+nc),console.info(`
10
10
  ${by}Valid arguments are below.`+nc),printHelpSections(["flags","paramOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>reArgs.infoCmds.help.test(e)))printHelpSections();else if(process.argv.some(e=>reArgs.infoCmds.version.test(e))){const k=execSync(`npm view ${pkgName} version`).toString().trim()||"none";let e,i=process.cwd();for(;"/"!=i;){const n=path.join(i,"package.json");if(fs.existsSync(n)){const o=require(n);e=(o.dependencies?.[pkgName]||o.devDependencies?.[pkgName])?.match(/(\d+\.\d+\.\d+)/)[0]||"none";break}i=path.dirname(i)}console.info(`
11
11
  Global version: `+k),console.info("Local version: "+e)}else{const[p="",q=""]=process.argv.slice(2).filter(e=>!e.startsWith("-")).map(e=>e.replace(/^\/*/,"")),r=path.resolve(process.cwd(),p),s=(p&&!fs.existsSync(r)&&(console.error(`
12
12
  ${br}Error: First argument can only be an existing file or directory.`+`
13
13
  ${r} does not exist.`+nc+`
14
14
 
15
15
  ${bg}Example valid command:
16
- » minify-js . output.min.js`+nc),printHelpCmdAndDocURL(),process.exit(1)),p.endsWith(".js")?[r]:minifyJS.findJS(r,{recursive:!config.noRecursion,verbose:!config.quietMode}));if(config.dryRun)0<s.length?(console.info(`
16
+ » minify-js . output.min.js`+nc),printHelpCmdAndDocURL(),process.exit(1)),p.endsWith(".js")?[r]:minifyJS.findJS(r,{recursive:!config.noRecursion,verbose:!config.quietMode,ignoreFiles:(config.ignoreFiles?.split(",")??[]).map(e=>e.trim())}));if(config.dryRun)0<s.length?(console.info(`
17
17
  ${by}JS files to be minified:`+nc),s.forEach(e=>console.info(e))):console.info(by+`
18
- No JS files will be minified.`+nc);else{const w=[],x=s.map(e=>{var n=minifyJS.minify(e,{verbose:!config.quietMode,mangle:!config.noMangle,comment:config.comment?.replace(/\\n/g,"\n")});return n.error&&w.push(e),n}).filter(e=>!e.error);x?.forEach(({code:e,srcPath:n})=>{var i=path.join(path.dirname(n),(/so?u?rce?$/.test(path.dirname(n))?"../":"")+(q.endsWith(".js")?path.dirname(q):q||"min")),n=(q.endsWith(".js")&&p.endsWith(".js")?path.basename(q).replace(/(\.min)?\.js$/,""):path.basename(n,".js"))+".min.js",n=path.join(i,n);fs.existsSync(i)||fs.mkdirSync(i,{recursive:!0}),fs.writeFileSync(n,e,"utf8")}),0<x?.length?(printIfNotQuiet(`
19
- ${bg}Minification complete!`+nc),printIfNotQuiet(`${x.length} file${1<x.length?"s":""} minified.`)):printIfNotQuiet(by+"No unminified JavaScript files processed."+nc),0<w.length&&(printIfNotQuiet(`
20
- `+br+w.length+" file"+(1<w.length?"s":"")+" failed to minify:"+nc),w.forEach(e=>printIfNotQuiet(e)))}}function printHelpSections(e=["header","usage","pathArgs","flags","paramOptions","infoCmds"]){var n=` ${pkgName.replace(/^@[^/]+\//,"")} ${nc} `;const i={header:[`
21
- ├ `+n+copyright,n+"Source: "+srcURL],usage:[`
18
+ No JS files will be minified.`+nc);else{const x=[],y=s.map(e=>{var i=minifyJS.minify(e,{verbose:!config.quietMode,mangle:!config.noMangle,comment:config.comment?.replace(/\\n/g,"\n")});return i.error&&x.push(e),i}).filter(e=>!e.error);y?.forEach(({code:e,srcPath:i})=>{var n=path.join(path.dirname(i),(/so?u?rce?$/.test(path.dirname(i))?"../":"")+(q.endsWith(".js")?path.dirname(q):q||"min")),i=(q.endsWith(".js")&&p.endsWith(".js")?path.basename(q).replace(/(\.min)?\.js$/,""):path.basename(i,".js"))+".min.js",i=path.join(n,i);fs.existsSync(n)||fs.mkdirSync(n,{recursive:!0}),fs.writeFileSync(i,e,"utf8")}),0<y?.length?(printIfNotQuiet(`
19
+ ${bg}Minification complete!`+nc),printIfNotQuiet(`${bw+y.length} file${1<y.length?"s":""} minified.`+nc)):printIfNotQuiet(by+"No unminified JavaScript files processed."+nc),0<x.length&&(printIfNotQuiet(`
20
+ `+br+x.length+" file"+(1<x.length?"s":"")+" failed to minify:"+nc),x.forEach(e=>printIfNotQuiet(e)))}}function printHelpSections(e=["header","usage","pathArgs","flags","paramOptions","infoCmds"]){var i=` ${pkgName.replace(/^@[^/]+\//,"")} ${nc} `;const n={header:[`
21
+ ├ `+i+copyright,i+"Source: "+srcURL],usage:[`
22
22
  ${bw}o Usage:`+nc,` ${bw}» `+(bg+cmdFormat+nc)],pathArgs:[`
23
- ${bw}o Path arguments:`+nc," [inputPath] Path to JS file or directory containing JS files to be minified, relative to the current working directory."," [outputPath] Path to file or directory where minified files will be stored, relative to original file location (if not provided, min/ is used)."],flags:[`
24
- ${bw}o Boolean options:`+nc," -n, --dry-run Don't actually minify the file(s), just show if they will be processed."," -d, --include-dotfolders Include dotfolders in file search."," -D, --include-dotfiles Include dotfiles in file search."," -R, --no-recursion Disable recursive file searching."," -M, --no-mangle Disable mangling names."," -q, --quiet Suppress all logging except errors."],paramOptions:[`
25
- ${bw}o Parameter options:`+nc,'--comment="comment" Prepend comment to minified code.'],infoCmds:[`
26
- ${bw}o Info commands:`+nc," -h, --help Display help screen."," -v, --version Show version number."]};e.forEach(t=>{i[t]?.forEach(e=>{{var o=/header|usage/.test(t)?1:29;const r=process.stdout.columns||80,s=[],n=e.match(/\S+|\s+/g);let i="";n.forEach(e=>{var n=r-(0==s.length?0:o);i.length+"| ".length+e.length>n&&(s.push(0==s.length?i:i.trimStart()),i=""),i+=e}),s.push(0==s.length?i:i.trimStart()),s.forEach((e,n)=>console.info("| "+(0==n?e:" ".repeat(o)+e)))}})}),console.info("\nFor more help, please visit: "+bw+docURL+nc)}function printHelpCmdAndDocURL(){console.info(`
23
+ ${bw}o Path arguments:`+nc," [inputPath] Path to JS file or directory containing JS files to be minified, relative to the current working directory."," [outputPath] Path to file or directory where minified files will be stored, relative to original file location (if not provided, min/ is used)."],flags:[`
24
+ ${bw}o Boolean options:`+nc," -n, --dry-run Don't actually minify the file(s), just show if they will be processed."," -d, --include-dotfolders Include dotfolders in file search."," -D, --include-dotfiles Include dotfiles in file search."," -R, --no-recursion Disable recursive file searching."," -M, --no-mangle Disable mangling names."," -q, --quiet Suppress all logging except errors."],paramOptions:[`
25
+ ${bw}o Parameter options:`+nc,'--ignore-files="file1.js,file2.js" Files to exclude from minification.',"--comment=\"comment\" Prepend comment to minified code. Separate by line using '\\n'."],infoCmds:[`
26
+ ${bw}o Info commands:`+nc," -h, --help Display help screen."," -v, --version Show version number."]};e.forEach(t=>{n[t]?.forEach(e=>{{var o=/header|usage/.test(t)?1:37;const s=process.stdout.columns||80,r=[],i=e.match(/\S+|\s+/g);let n="";i.forEach(e=>{var i=s-(0==r.length?0:o);n.length+"| ".length+e.length>i&&(r.push(0==r.length?n:n.trimStart()),n=""),n+=e}),r.push(0==r.length?n:n.trimStart()),r.forEach((e,i)=>console.info("| "+(0==i?e:" ".repeat(o)+e)))}})}),console.info("\nFor more help, please visit: "+bw+docURL+nc)}function printHelpCmdAndDocURL(){console.info(`
27
27
  For more help, type 'minify.js --help' or visit
28
28
  `+(bw+docURL+nc))}function printIfNotQuiet(e){config.quietMode||console.info(e)}
@@ -4,10 +4,10 @@
4
4
  * Source: https://code.minify-js.org/node.js
5
5
  * Documentation: https://docs.minify-js.org/node.js
6
6
  */
7
- const fs=require("fs"),path=require("path"),uglifyJS=require("uglify-js");function findJS(i,n={}){var e="https://docs.minify-js.org/node.js/#findjssearchdir-options",o={recursive:!0,verbose:!0,dotFolders:!1,dotFiles:!1};if("string"!=typeof i)console.error("findJS() » ERROR: 1st arg <searchDir> must be a string."),console.info("findJS() » For more help, please visit "+e);else{var r=path.resolve(process.cwd(),i);if(fs.existsSync(r)){if(validateOptions(n,o,e,"findJS('assets/js', { verbose: false, dotFoldes: true })")){n={...o,...n};const s=fs.readdirSync(i),t=[];return n.verbose&&!n.isRecursing&&console.info("findJS() » Searching for unminified JS files..."),s.forEach(e=>{var o=path.resolve(i,e);fs.statSync(o).isDirectory()&&"node_modules"!=e&&(n.dotFolders||!e.startsWith("."))&&n.recursive?t.push(...findJS(o,{...n,isRecursing:!0})):!/\.js(?<!\.min\.js)$/.test(e)||!n.dotFiles&&e.startsWith(".")||t.push(o)}),!n.isRecursing&&n.verbose&&(console.info("findJS() » Search complete! "+(0==t.length?"No":t.length)+` file${0==t.length||1<t.length?"s":""} found.`),"minify"==findJS.caller.name||process.argv.some(e=>e.includes("gulp"))||/cli(?:\.min)?\.js$/.test(require.main.filename)||console.info("findJS() » Check returned array.")),n.isRecursing||0<t.length?t:[]}}else console.error("findJS() » ERROR: 1st arg <searchDir> must be an existing directory."),console.error(`findJS() » ${r} does not exist.`),console.info("findJS() » For more help, please visit "+e)}}function minify(e,n={}){var o="https://docs.minify-js.org/node.js/#minifyinput-options",i={recursive:!0,verbose:!0,dotFolders:!1,dotFiles:!1,mangle:!0,comment:""};if("string"!=typeof e)console.error("minify() » ERROR: 1st arg <input> must be a string."),console.info("minify() » For more help, please visit "+o);else if(validateOptions(n,i,o,"minify('assets/js', { recursive: false, mangle: false })")){const s={mangle:(n={...i,...n}).mangle};return fs.existsSync(e)?e.endsWith(".js")?(n.verbose&&console.info(`minify() » Minifying ${e}...`),o=uglifyJS.minify(fs.readFileSync(e,"utf8"),s),n.comment&&(o.code=r(o.code)),o.error?console.error("minify() » ERROR: "+o.error.message):!n.verbose||process.argv.some(e=>e.includes("gulp"))||/cli(?:\.min)?\.js$/.test(require.main.filename)||console.info("minify() » Minification complete. Check returned object."),{code:o.code,srcPath:path.resolve(process.cwd(),e),error:o.error}):(i=findJS(e,{recursive:n.recursive,verbose:n.verbose,dotFolders:n.dotFolders,dotFiles:n.dotFiles})?.map(e=>{n.verbose&&console.info(`minify() » Minifying ${e}...`);var o=fs.readFileSync(e,"utf8"),o=uglifyJS.minify(o,s);return n.comment&&(o.code=r(o.code)),o.error&&console.error("minify() » ERROR: "+o.error.message),{code:o.code,srcPath:e,error:o.error}}).filter(e=>!e.error),n.verbose&&(0<i.length?console.info("minify() » Minification complete. Check returned object."):console.info("minify() » No unminified JavaScript files processed.")),i):(n.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » Minifying passed source code..."),o=uglifyJS.minify(e,s),n.comment&&(o.code=r(o.code)),o.error?console.error("minify() » ERROR: "+o.error.message):n.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » Minification complete. Check returned object."),{code:o.code,srcPath:void 0,error:o.error});function r(e){var o=n.comment.split("\n").map(e=>" * "+e).join("\n"),i=e.indexOf("#!");return 0<=i?(i=e.indexOf("\n",i)+1,e.slice(0,i)+`/**
7
+ const fs=require("fs"),path=require("path"),uglifyJS=require("uglify-js");function findJS(i,n={}){var e="https://docs.minify-js.org/node.js/#findjssearchdir-options",o={recursive:!0,verbose:!0,dotFolders:!1,dotFiles:!1,ignoreFiles:[]};if("string"!=typeof i)console.error("findJS() » ERROR: 1st arg <searchDir> must be a string."),console.info("findJS() » For more help, please visit "+e);else{var r=path.resolve(process.cwd(),i);if(fs.existsSync(r)){if(validateOptions(n,o,e,"findJS('assets/js', { verbose: false, dotFoldes: true })")){n={...o,...n};const s=fs.readdirSync(i),t=[];return n.verbose&&!n.isRecursing&&console.info("findJS() » Searching for unminified JS files..."),s.forEach(e=>{var o=path.resolve(i,e);fs.statSync(o).isDirectory()&&"node_modules"!=e&&n.recursive&&(n.dotFolders||!e.startsWith("."))?t.push(...findJS(o,{...n,isRecursing:!0})):!/\.js(?<!\.min\.js)$/.test(e)||!n.dotFiles&&e.startsWith(".")||n.ignoreFiles.includes(e)?n.verbose&&n.ignoreFiles.includes(e)&&console.info(`findJS() » ** ${e} ignored due to [options.ignoreFiles]`):t.push(o)}),!n.isRecursing&&n.verbose&&(console.info("findJS() » Search complete! "+(0==t.length?"No":t.length)+` file${0==t.length||1<t.length?"s":""} found.`),"minify"==findJS.caller.name||process.argv.some(e=>e.includes("gulp"))||/cli(?:\.min)?\.js$/.test(require.main.filename)||console.info("findJS() » Check returned array.")),n.isRecursing||0<t.length?t:[]}}else console.error("findJS() » ERROR: 1st arg <searchDir> must be an existing directory."),console.error(`findJS() » ${r} does not exist.`),console.info("findJS() » For more help, please visit "+e)}}function minify(e,i={}){var o="https://docs.minify-js.org/node.js/#minifyinput-options",n={recursive:!0,verbose:!0,dotFolders:!1,dotFiles:!1,mangle:!0,ignoreFiles:[],comment:""};if("string"!=typeof e)console.error("minify() » ERROR: 1st arg <input> must be a string."),console.info("minify() » For more help, please visit "+o);else if(validateOptions(i,n,o,"minify('assets/js', { recursive: false, mangle: false })")){const s={mangle:(i={...n,...i}).mangle};return fs.existsSync(e)?e.endsWith(".js")?(i.verbose&&console.info(`minify() » ** Minifying ${e}...`),o=uglifyJS.minify(fs.readFileSync(e,"utf8"),s),i.comment&&(o.code=r(o.code,i.comment)),o.error?console.error("minify() » ERROR: "+o.error.message):!i.verbose||process.argv.some(e=>e.includes("gulp"))||/cli(?:\.min)?\.js$/.test(require.main.filename)||console.info("minify() » Minification complete! Check returned object."),{code:o.code,srcPath:path.resolve(process.cwd(),e),error:o.error}):(n=findJS(e,{recursive:i.recursive,verbose:i.verbose,dotFolders:i.dotFolders,dotFiles:i.dotFiles,ignoreFiles:i.ignoreFiles})?.map(e=>{i.verbose&&console.info(`minify() » ** Minifying ${e}...`);var o=fs.readFileSync(e,"utf8"),o=uglifyJS.minify(o,s);return i.comment&&(o.code=r(o.code,i.comment)),o.error&&console.error("minify() » ERROR: "+o.error.message),{code:o.code,srcPath:e,error:o.error}}).filter(e=>!e.error),i.verbose&&(0<n.length?console.info("minify() » Minification complete! Check returned object."):console.info("minify() » No unminified JavaScript files processed.")),n):(i.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » ** Minifying passed source code..."),o=uglifyJS.minify(e,s),i.comment&&(o.code=r(o.code,i.comment)),o.error?console.error("minify() » ERROR: "+o.error.message):i.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » Minification complete! Check returned object."),{code:o.code,srcPath:void 0,error:o.error});function r(e,o){var o=o.split("\n").map(e=>" * "+e).join("\n"),i=e.indexOf("#!");return 0<=i?(i=e.indexOf("\n",i)+1,e.slice(0,i)+`/**
8
8
  ${o}
9
9
  */
10
10
  `+e.slice(i)):`/**
11
11
  ${o}
12
12
  */
13
- `+e}}}function validateOptions(e,o,i,n){const r=JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),s=Object.keys(o).join(", "),t=Object.keys(o).filter(e=>"boolean"==typeof o[e]),l=Object.keys(o).filter(e=>Number.isInteger(o[e]));let c="validateOptions() » ";try{c=validateOptions.caller?.name+"() » "}catch(e){}var f=n.split(",").findIndex(e=>e.trim().startsWith("{"))+1,a=(f+=["st","nd","rd"][f-1]||"th",()=>{console.info(`${c}Valid options: [ ${s} ]`),console.info(c+"If omitted, default settings are: "+r)}),d=()=>{console.info(c+"For more help, please visit "+i)};if("object"!=typeof e)return console.error(c+`ERROR: ${"0th"==f?"[O":f+" arg [o"}ptions] can only be an object of key/values.`),console.info(c+"Example valid call: "+n),a(),d(),!1;for(const u in e){if("isRecursing"!=u&&!Object.prototype.hasOwnProperty.call(o,u))return console.error(`${c}ERROR: \`${u}\` is an invalid option.`),a(),d(),!1;if(t.includes(u)){if("mangle"==u){var m=()=>console.error(c+"ERROR: [mangle] option can only be `true`, `false`, or an object w/ key [toplevel] set to `true` or `false`.");if("object"==typeof e.mangle){for(const p in e.mangle)if(!["toplevel"].includes(p)||"boolean"!=typeof e.mangle[p])return m(),d(),!1}else if("boolean"!=typeof e.mangle)return m(),d(),!1}else if("boolean"!=typeof e[u])return console.error(`${c}ERROR: [${u}] option can only be \`true\` or \`false\`.`),d(),!1}else if(l.includes(u)&&(e[u]=parseInt(e[u],10),isNaN(e[u])||e[u]<1))return console.error(`${c}ERROR: [${u}] option can only be an integer > 0.`),d(),!1}return!0}const funcAliases={minify:["compress"],findJS:["find","findJs","findjs","search"]};module.exports={minify:minify,findJS:findJS};for(const $ in funcAliases)funcAliases[$].forEach(e=>module.exports[e]=module.exports[$]);
13
+ `+e}}}function validateOptions(e,o,i,n){const r=JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),s=Object.keys(o).join(", "),t=Object.keys(o).filter(e=>"boolean"==typeof o[e]),l=Object.keys(o).filter(e=>Number.isInteger(o[e])),c=Object.keys(o).filter(e=>Array.isArray(o[e]));let f="validateOptions() » ";try{f=validateOptions.caller?.name+"() » "}catch(e){}var a=n.split(",").findIndex(e=>e.trim().startsWith("{"))+1,d=(a+=["st","nd","rd"][a-1]||"th",()=>{console.info(`${f}Valid options: [ ${s} ]`),console.info(f+"If omitted, default settings are: "+r)}),m=()=>{console.info(f+"For more help, please visit "+i)};if("object"!=typeof e)return console.error(f+`ERROR: ${"0th"==a?"[O":a+" arg [o"}ptions] can only be an object of key/values.`),console.info(f+"Example valid call: "+n),d(),m(),!1;for(const p in e){if("isRecursing"!=p&&!Object.prototype.hasOwnProperty.call(o,p))return console.error(`${f}ERROR: \`${p}\` is an invalid option.`),d(),m(),!1;if(t.includes(p)){if("mangle"==p){var u=()=>console.error(f+"ERROR: [mangle] option can only be `true`, `false`, or an object w/ key [toplevel] set to `true` or `false`.");if("object"==typeof e.mangle){for(const y in e.mangle)if(!["toplevel"].includes(y)||"boolean"!=typeof e.mangle[y])return u(),m(),!1}else if("boolean"!=typeof e.mangle)return u(),m(),!1}else if("boolean"!=typeof e[p])return console.error(`${f}ERROR: [${p}] option can only be \`true\` or \`false\`.`),m(),!1}else if(l.includes(p)){if(e[p]=parseInt(e[p],10),isNaN(e[p])||e[p]<1)return console.error(`${f}ERROR: [${p}] option can only be an integer > 0.`),m(),!1}else if(c.includes(p))if("string"!=typeof e[p]||e[p].includes(",")){if(!Array.isArray(e[p]))return console.error(`${f}ERROR: [${p}] option can only be an array.`),m(),!1}else e[p]=[e[p]]}return!0}const funcAliases={minify:["build","Build","compile","Compile","compress","Compress","Minify"],findJS:["find","Find","findjs","findJs","Findjs","FindJs","FindJS","search","Search"]};module.exports={minify:minify,findJS:findJS};for(const ba in funcAliases)funcAliases[ba].forEach(e=>module.exports[e]=module.exports[ba]);
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://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/white/icon32.svg">
5
- <img height=14 src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/black/icon32.svg">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.minify-js.org/images/icons/earth/white/icon32.svg?d07ee82">
5
+ <img height=14 src="https://media.minify-js.org/images/icons/earth/black/icon32.svg?d07ee82">
6
6
  </picture>
7
7
  &nbsp;English |
8
8
  <a href="zh-cn/LICENSE.md">简体中文</a> |
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://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/white/icon32.svg">
5
- <img height=14 src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/black/icon32.svg">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.minify-js.org/images/icons/earth/white/icon32.svg?d07ee82">
5
+ <img height=14 src="https://media.minify-js.org/images/icons/earth/black/icon32.svg?d07ee82">
6
6
  </picture>
7
7
  &nbsp;English |
8
8
  <a href="https://github.minify-js.org/tree/main/node.js/docs/zh-cn/#readme">简体中文</a> |
@@ -23,17 +23,17 @@
23
23
 
24
24
  <a href="https://www.npmjs.com/package/@adamlui/minify.js"><img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fminify.js?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
25
25
  <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
- <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.5.8"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.5.8-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
26
+ <a href="https://github.com/adamlui/minify.js/releases/tag/node-v1.6.1"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.6.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
27
27
  <a href="https://www.npmjs.com/package/@adamlui/minify.js?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fminify.js?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
28
28
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_minify.js:node.js/src/minify.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_minify.js%3Anode.js%2Fsrc%2Fminify.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
29
29
  <a href="https://github.com/toolleeo/cli-apps#programming"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
30
30
  <a href="https://minify-js.org"><img height=31 src="https://img.shields.io/badge/web-minify--js.org-lightgrey?logo=dribbble&logoColor=white&labelColor=464646&style=for-the-badge"></a>
31
31
 
32
- <img src="https://raw.githubusercontent.com/adamlui/minify.js/main/node.js/media/images/screenshots/cli-minify-js-docs.png">
32
+ <img src="https://cdn.jsdelivr.net/gh/adamlui/minify.js@3d56890/node.js/media/images/screenshots/cli/minify-js-docs-cmd-output.png">
33
33
 
34
34
  <br>
35
35
 
36
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
36
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
37
37
 
38
38
  ## ⚡ Installation
39
39
 
@@ -57,7 +57,7 @@ $ npm install @adamlui/minify.js
57
57
 
58
58
  <br>
59
59
 
60
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
60
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
61
61
 
62
62
  ## 💻 Command line usage
63
63
 
@@ -128,26 +128,27 @@ $ minify-js input_folder output_folder
128
128
 
129
129
  ```
130
130
  Boolean options:
131
- -n, --dry-run Don't actually minify the file(s), just show
132
- if they will be processed.
133
- -d, --include-dotfolders Include dotfolders in file search.
134
- -D, --include-dotfiles Include dotfiles in file search.
135
- -R, --no-recursion Disable recursive file searching.
136
- -M, --no-mangle Disable mangling names.
137
- -q, --quiet Suppress all logging except errors.
131
+ -n, --dry-run Don't actually minify the file(s),
132
+ just show if they will be processed.
133
+ -d, --include-dotfolders Include dotfolders in file search.
134
+ -D, --include-dotfiles Include dotfiles in file search.
135
+ -R, --no-recursion Disable recursive file searching.
136
+ -M, --no-mangle Disable mangling names.
137
+ -q, --quiet Suppress all logging except errors.
138
138
 
139
139
  Parameter options:
140
- --comment="comment" Prepend comment to minified code. Separate
141
- by line using '\n'.
140
+ --ignore-files="file1.js,file2.js" Files to exclude from minification.
141
+ --comment="comment" Prepend comment to minified code.
142
+ Separate by line using '\n'.
142
143
 
143
144
  Info commands:
144
- -h, --help Display help screen.
145
- -v, --version Show version number.
145
+ -h, --help Display help screen.
146
+ -v, --version Show version number.
146
147
  ```
147
148
 
148
149
  <br>
149
150
 
150
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
151
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
151
152
 
152
153
  ## 🔌 API usage
153
154
 
@@ -205,14 +206,15 @@ minifyJS.minify(input, { dotFiles: true });
205
206
 
206
207
  Available parameters (and their default settings) are:
207
208
 
208
- Name | Type | Desciption | Default value
209
- -------------|---------|-------------------------------------------------------------------|---------------
210
- `recursive` | Boolean | Recursively search for nested files if dir path passed. | `true`
211
- `verbose` | Boolean | Show logging in console/terminal. | `true`
212
- `dotFolders` | Boolean | Include dotfolders in file search. | `false`
213
- `dotFiles` | Boolean | Include dotfiles in file search. | `false`
214
- `mangle` | Boolean | Shorten variable names (typically to one character). | `true`
215
- `comment` | String | Comment to prepend to minified code. Separate by line using '\n'. | `''`
209
+ Name | Type | Desciption | Default value
210
+ --------------|---------|-------------------------------------------------------------------|---------------
211
+ `recursive` | Boolean | Recursively search for nested files if dir path passed. | `true`
212
+ `verbose` | Boolean | Show logging in console/terminal. | `true`
213
+ `dotFolders` | Boolean | Include dotfolders in file search. | `false`
214
+ `dotFiles` | Boolean | Include dotfiles in file search. | `false`
215
+ `mangle` | Boolean | Shorten variable names (typically to one character). | `true`
216
+ `ignoreFiles` | Array | Files (by name) to exclude from minification. | `[]`
217
+ `comment` | String | Comment to prepend to minified code. Separate by line using '\n'. | `''`
216
218
 
217
219
  #
218
220
 
@@ -241,16 +243,17 @@ findJS() » Check returned array.
241
243
 
242
244
  Available parameters (and their default settings) are:
243
245
 
244
- Name | Type | Desciption | Default value
245
- -------------|---------|----------------------------------------------------------|---------------
246
- `recursive` | Boolean | Recursively search for nested files in searchDir passed. | `true`
247
- `verbose` | Boolean | Show logging in console/terminal. | `true`
248
- `dotFolders` | Boolean | Include dotfolders in file search. | `false`
249
- `dotFiles` | Boolean | Include dotfiles in file search. | `false`
246
+ Name | Type | Desciption | Default value
247
+ --------------|---------|----------------------------------------------------------|---------------
248
+ `recursive` | Boolean | Recursively search for nested files in searchDir passed. | `true`
249
+ `verbose` | Boolean | Show logging in console/terminal. | `true`
250
+ `dotFolders` | Boolean | Include dotfolders in file search. | `false`
251
+ `dotFiles` | Boolean | Include dotfiles in file search. | `false`
252
+ `ignoreFiles` | Array | Files (by name) to exclude from search results. | `[]`
250
253
 
251
254
  <br>
252
255
 
253
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
256
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
254
257
 
255
258
  ## 🏛️ MIT License
256
259
 
@@ -264,30 +267,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
264
267
 
265
268
  <br>
266
269
 
267
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
270
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
268
271
 
269
272
  ## 🛠️ Related utilities
270
273
 
271
- ### [</> minify.js (Gulp)](https://gulp.minify-js.org) <a href="https://github.com/toolleeo/cli-apps#programming"><img height=18 src="https://awesome.re/mentioned-badge.svg"></a>
274
+ ### [</> minify.js (Gulp)](https://gulp.minify-js.org) <a href="https://github.com/toolleeo/cli-apps#programming"><img height=18 src="https://media.minify-js.org/images/badges/awesome/badge.svg?b78dcd3"></a>
272
275
 
273
276
  > Gulp plug-in to recursively minify all JavaScript files.
274
277
  <br>[Install](https://gulp.minify-js.org/#-installation) /
275
278
  [Readme](https://gulp.minify-js.org/#readme) /
276
279
  [Discuss](https://github.minify-js.org/discussions)
277
280
 
278
- ### [{ } scss-to-css](https://github.com/adamlui/scss-to-css) <a href="https://github.com/toolleeo/cli-apps#conversion"><img height=18 src="https://awesome.re/mentioned-badge.svg"></a>
281
+ ### [{ } scss-to-css](https://github.com/adamlui/scss-to-css) <a href="https://github.com/toolleeo/cli-apps#conversion"><img height=18 src="https://media.minify-js.org/images/badges/awesome/badge.svg?b78dcd3"></a>
279
282
 
280
283
  > Recursively compile all SCSS files into minified CSS.
281
- <br>[Install](https://github.com/adamlui/scss-to-css/#-installation) /
282
- [Readme](https://github.com/adamlui/scss-to-css/#readme) /
283
- [CLI usage](https://github.com/adamlui/scss-to-css/#-command-line-usage) /
284
- [API usage](https://github.com/adamlui/scss-to-css/#-api-usage) /
285
- [Discuss](https://github.com/adamlui/scss-to-css/discussions)
284
+ <br>[Install](https://node.scsstocss.org/#-installation) /
285
+ [Readme](https://node.scsstocss.org/#readme) /
286
+ [CLI usage](https://node.scsstocss.org/#-command-line-usage) /
287
+ [API usage](https://node.scsstocss.org/#-api-usage) /
288
+ [Discuss](https://github.scsstocss.org/discussions)
286
289
 
287
290
  <br>
288
291
 
289
- <img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
292
+ <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
290
293
 
291
- <picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/adamlui/js-utils/main/media/images/icons/home/white/icon32x27.png"><img height=13 src="https://raw.githubusercontent.com/adamlui/js-utils/main/media/images/icons/home/dark-gray/icon32x27.png"></picture> <a href="https://js-utils.com">**More JavaScript utilities**</a> /
294
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.minify-js.org/images/icons/home/white/icon32x27.png?d07ee82"><img height=13 src="https://media.minify-js.org/images/icons/home/dark-gray/icon32x27.png?d07ee82"></picture> <a href="https://js-utils.com">**More JavaScript utilities**</a> /
292
295
  <a href="https://github.minify-js.org/discussions">Discuss</a> /
293
296
  <a href="#-minifyjs">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://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/white/icon32.svg">
5
- <img height=14 src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/earth-icon/black/icon32.svg">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://media.minify-js.org/images/icons/earth/white/icon32.svg?d07ee82">
5
+ <img height=14 src="https://media.minify-js.org/images/icons/earth/black/icon32.svg?d07ee82">
6
6
  </picture>
7
7
  &nbsp;English |
8
8
  <a href="zh-cn/SECURITY.md">简体中文</a> |
@@ -19,6 +19,6 @@
19
19
 
20
20
  # 🛡️ Security Policy
21
21
 
22
- If you find a vulnerability, please open a [draft security advisory](https://github.com/adamlui/minify.js/security/advisories/new).
22
+ If you find a vulnerability, please open a [draft security advisory](https://github.minify-js.org/security/advisories/new).
23
23
 
24
24
  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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamlui/minify.js",
3
- "version": "1.5.8",
3
+ "version": "1.6.1",
4
4
  "description": "Recursively minify all JavaScript files",
5
5
  "author": {
6
6
  "name": "Adam Lui",