@adamlui/minify.js 1.8.4 → 1.8.6

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://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">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.minify-js.org/images/icons/earth/white/icon32.svg?v=ad67551">
5
+ <img height=14 src="https://assets.minify-js.org/images/icons/earth/black/icon32.svg?v=ad67551">
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> |
@@ -21,19 +21,26 @@
21
21
 
22
22
  ### Recursively minify all JavaScript files.
23
23
 
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
- <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.8.4"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.4-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
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
- <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
- <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
- <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>
24
+ <a href="https://www.npmjs.com/package/@adamlui/minify.js">
25
+ <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>
26
+ <a href="#%EF%B8%8F-mit-license">
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/minify.js/releases/tag/node-v1.8.6">
29
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.6-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
30
+ <a href="https://www.npmjs.com/package/@adamlui/minify.js?activeTab=code">
31
+ <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>
32
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_minify.js:node.js/src/minify.js">
33
+ <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>
34
+ <a href="https://github.com/toolleeo/cli-apps#programming">
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>
36
+ <a href="https://minify-js.org">
37
+ <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
38
 
32
39
  <img src="https://cdn.jsdelivr.net/gh/adamlui/minify.js@3d56890/node.js/media/images/screenshots/cli/minify-js-docs-cmd-output.png">
33
40
 
34
41
  <br>
35
42
 
36
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
43
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
37
44
 
38
45
  ## ⚡ Installation
39
46
 
@@ -57,9 +64,9 @@ $ npm install @adamlui/minify.js
57
64
 
58
65
  <br>
59
66
 
60
- <a href="https://github.com/sponsors/adamlui"><img src="https://media.minify-js.org/images/banners/sponsor/$10/banner1660x260.png?f6118ce"></a>
67
+ <a href="https://github.com/sponsors/adamlui"><img src="https://assets.minify-js.org/images/banners/sponsor/$10/banner1660x260.png?v=63bbeed"></a>
61
68
 
62
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
69
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
63
70
 
64
71
  ## 💻 Command line usage
65
72
 
@@ -154,7 +161,7 @@ Info commands:
154
161
 
155
162
  <br>
156
163
 
157
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
164
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
158
165
 
159
166
  ## 🔌 API usage
160
167
 
@@ -259,11 +266,11 @@ Name | Type | Desciption
259
266
 
260
267
  <br>
261
268
 
262
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
269
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
263
270
 
264
271
  ## 🏛️ MIT License
265
272
 
266
- **Copyright © 2023–2024 [Adam Lui](https://github.com/adamlui) & contributors.**
273
+ **Copyright © 2023–2025 [Adam Lui](https://github.com/adamlui) & contributors.**
267
274
 
268
275
  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:
269
276
 
@@ -273,30 +280,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
273
280
 
274
281
  <br>
275
282
 
276
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
283
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
277
284
 
278
285
  ## 🛠️ Related utilities
279
286
 
280
- ### [</> minify.js (Gulp)](https://gulp.minify-js.org) &nbsp;<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>
287
+ ### [</> minify.js (Gulp)](https://gulp.minify-js.org) &nbsp;<a href="https://github.com/toolleeo/cli-apps#programming"><img height=18 src="https://assets.minify-js.org/images/badges/awesome/badge.svg?v=63bbeed"></a>
281
288
 
282
289
  > Gulp plug-in to recursively minify all JavaScript files.
283
290
  <br>[Install](https://gulp.minify-js.org/#-installation) /
284
291
  [Readme](https://gulp.minify-js.org/#readme) /
285
- [Discuss](https://github.minify-js.org/discussions)
292
+ [Discuss](https://github.com/adamlui/minify.js/discussions)
286
293
 
287
- ### [{ } scss-to-css](https://github.com/adamlui/scss-to-css) &nbsp;<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>
294
+ ### [{ } scss-to-css](https://scsstocss.org) &nbsp;<a href="https://github.com/toolleeo/cli-apps#conversion"><img height=18 src="https://assets.minify-js.org/images/badges/awesome/badge.svg?v=63bbeed"></a>
288
295
 
289
296
  > Recursively compile all SCSS files into minified CSS.
290
297
  <br>[Install](https://node.scsstocss.org/#-installation) /
291
298
  [Readme](https://node.scsstocss.org/#readme) /
292
299
  [CLI usage](https://node.scsstocss.org/#-command-line-usage) /
293
300
  [API usage](https://node.scsstocss.org/#-api-usage) /
294
- [Discuss](https://github.scsstocss.org/discussions)
301
+ [Discuss](https://github.com/adamlui/scss-to-css/discussions)
295
302
 
296
303
  <br>
297
304
 
298
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
305
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
299
306
 
300
- <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> /
301
- <a href="https://github.minify-js.org/discussions">Discuss</a> /
307
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.minify-js.org/images/icons/home/white/icon32x27.png?v=ad67551"><img height=13 src="https://assets.minify-js.org/images/icons/home/dark-gray/icon32x27.png?v=ad67551"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
308
+ <a href="https://github.com/adamlui/minify.js/discussions">Discuss</a> /
302
309
  <a href="#-minifyjs">Back to top ↑</a>
package/dist/cli.min.js CHANGED
@@ -1,31 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * © 2023–2024 Adam Lui & contributors under the MIT license.
3
+ * © 2023–2025 Adam Lui & contributors under the MIT license.
4
4
  * Source: https://code.minify-js.org/node.js
5
5
  * Documentation: https://docs.minify-js.org/node.js
6
6
  */
7
- let 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";(async()=>{let r=require(__dirname.match(/src/)?"./minify":"./minify.min"),t=require("fs"),l=require("path"),i=require("node-clipboardy"),o=require("child_process").execSync,a="",c="",m="",f="",d="",p="en";if("win32"==process.platform)try{p=o("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){}else{var g=process.env;p=(g.LANG||g.LANGUAGE||g.LC_ALL||g.LC_MESSAGES||g.LC_NAME||"en").split(".")[0]}let h={};g=new Promise((s,r)=>{let t="https://cdn.jsdelivr.net/gh/adamlui/minify.js@dcb54b5f09ff44d9b68431328b7baaa7240a4a9e/_locales/",e=(p?p.replace("-","_"):"en")+"/",l=t+e+"messages.json",a=0;$(l).then(async function i(o){try{let e=await o.json(),i={};for(var n in e)"object"==typeof e[n]&&"message"in e[n]&&(i[n]=e[n].message);s(i)}catch(e){if(3==++a)return s({});$(l=p.includes("-")&&1==a?l.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):t+"en/messages.json").then(i).catch(r)}}).catch(r)});try{h=await g}catch(e){}let u={},s={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))$/,noFilenameChange:/^--?(?:X|(?:disable|no)-?(?:file)?name-?change|(?:file)?name-?change=(?:false|0))$/,copy:/^--?c(?:opy)?$/,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,o,n;i.startsWith("-")&&(n=Object.keys(s.flags).find(e=>s.flags[e].test(i)),e=Object.keys(s.paramOptions).find(e=>s.paramOptions[e].test(i)),o=Object.keys(s.infoCmds).find(e=>s.infoCmds[e].test(i)),n?u[n]=!0:e?(/=.+/.test(i)||(console.error(`
8
- ${c+(h.prefix_error||"ERROR")}: `+`Arg [--${i.replace(/-/g,"")}] `+`${h.error_noEqual||"requires '=' followed by a value"}.${a}`),_(),process.exit(1)),n=i.split("=")[1],u[e]=parseInt(n)||n):o||(console.error(`
9
- ${c+(h.prefix_error||"ERROR")}: `+`Arg [${i}] ${h.error_notRecognized||"not recognized"}.`),console.info(`
10
- ${m+(h.info_validArgs||"Valid arguments are below")}.`),y(["flags","paramOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>s.infoCmds.help.test(e)))y();else if(process.argv.some(e=>s.infoCmds.version.test(e))){g=o(`npm view ${pkgName} version`).toString().trim()||"none";let e,i=process.cwd();for(;"/"!=i;){var n=l.join(i,"package.json");if(t.existsSync(n)){n=require(n);e=(n.dependencies?.[pkgName]||n.devDependencies?.[pkgName])?.match(/(\d+\.\d+\.\d+)/)[0]||"none";break}i=l.dirname(i)}console.info(`
11
- ${h.prefix_globalVer||"Global version"}: `+g),console.info(`${h.prefix_localVer||"Local version"}: `+e)}else{let[n="",s=""]=process.argv.slice(2).filter(e=>!e.startsWith("-")).map(e=>e.replace(/^\/*/,"")),e=l.resolve(process.cwd(),n);n&&!t.existsSync(e)&&(g=e+".js",t.existsSync(g)?e=g:(console.error(`
12
- ${c+(h.prefix_error||"ERROR")}: `+`${h.error_firstArgNotExist||"First argument can only be an existing file or directory"}.`+`
13
- ${e} ${h.error_doesNotExist||"does not exist"}.`),console.info(`
14
- ${f}${h.info_exampleValidCmd||"Example valid command"}: `+`
15
- » minify-js . output.min.js`),_(),process.exit(1)));g=e.endsWith(".js")&&!t.statSync(e).isDirectory()?[e]:r.findJS(e,{recursive:!u.noRecursion,verbose:!u.quietMode,ignoreFiles:(u.ignoreFiles?.split(",")??[]).map(e=>e.trim())});if(u.dryRun)0<g.length?(console.info(`
16
- ${m+(h.info_filesToBeMinned||"JS files to be minified")}:`),g.forEach(e=>console.info(e))):console.info(`
17
- ${m+(h.info_noFilesWillBeMinned||"No JS files will be minified")}.`);else{let o=[];g=g.map(e=>{var i=r.minify(e,{verbose:!u.quietMode,mangle:!u.noMangle,comment:u.comment?.replace(/\\n/g,"\n")});return i.error&&o.push(e),i}).filter(e=>!e.error);0<g?.length?(v(`
18
- ${f+(h.info_minComplete||"Minification complete")}!`),v(d+g.length+" "+(h.info_file||"file")+`${1<g.length?"s":""} ${h.info_minified||"minified"}.${a}`)):v(`
19
- ${m+(h.info_noFilesProcessed||"No unminified JavaScript files processed")}.`),0<o.length&&(v(`
20
- ${c+o.length} `+(h.info_file||"file")+`${1<o.length?"s":""} ${h.info_failedToMinify||"failed to minify"}:${a}`),o.forEach(e=>v(e))),0!=g?.length&&(u.copy&&1==g?.length?(console.log(`
21
- `+d+g[0].code+a),v(`
22
- ${h.info_copying||"Copying to clipboard"}...`),i.writeSync(g[0].code)):(v(`
23
- ${h.info_writing||"Writing to file"}${1<g?.length?"s":""}...`),g?.forEach(({code:e,srcPath:i})=>{var o=l.join(l.dirname(i),(/so?u?rce?$/.test(l.dirname(i))?"../":"")+(s.endsWith(".js")?l.dirname(s):s||"min")),i=(s.endsWith(".js")&&n.endsWith(".js")?l.basename(s).replace(/(\.min)?\.js$/,""):l.basename(i,".js"))+`${u.noFilenameChange?"":".min"}.js`,i=l.join(o,i);t.existsSync(o)||t.mkdirSync(o,{recursive:!0}),t.writeFileSync(i,e,"utf8")})))}}function $(n){return new Promise((o,e)=>{var i=n.match(/^([^:]+):\/\//)[1];/^https?$/.test(i)||e(new Error(`${h.error_invalidURL||"Invalid URL"}.`)),require(i).get(n,e=>{let i="";e.on("data",e=>i+=e),e.on("end",()=>o({json:()=>JSON.parse(i)}))}).on("error",e)})}function y(e=["header","usage","pathArgs","flags","paramOptions","infoCmds"]){var i=` ${pkgName.replace(/^@[^/]+\//,"")}  `;let o={header:["\n├ "+i+(h.appCopyright||copyright),i+(h.prefix_source||"Source")+": "+srcURL],usage:[`
24
- ${d}o ${h.helpSection_usage||"Usage"}:`,` ${d}» `+f+cmdFormat+a],pathArgs:[`
25
- ${d}o ${h.helpSection_pathArgs||"Path arguments"}:`," [inputPath] "+`${h.inputPathDesc_main||"Path to JS file or directory containing JS files to be minified"}, `+`${h.inputPathDesc_extra||"relative to the current working directory"}.`," [outputPath] "+`${h.outputPathDesc_main||"Path to file or directory where minified files will be stored"}, `+`${h.outputPathDesc_extra||"relative to original file location (if not provided, min/ is used)"}.`],flags:[`
26
- ${d}o ${h.helpSection_flags||"Boolean options"}:`," -n, --dry-run "+`${h.optionDesc_dryRun||"Don't actually minify the file(s), just show if they will be processed"}.`,` -d, --include-dotfolders ${h.optionDesc_dotfolders||"Include dotfolders in file search"}.`,` -D, --include-dotfiles ${h.optionDesc_dotfiles||"Include dotfiles in file search"}.`,` -R, --no-recursion ${h.optionDesc_noRecursion||"Disable recursive file searching"}.`,` -M, --no-mangle ${h.optionDesc_noMangle||"Disable mangling names"}.`," -X, --no-filename-change "+(h.optionDesc_noFilenameChange||"Disable changing file extension to .min.js"),` -c, --copy ${h.optionDesc_copy||"Copy minified code to clipboard instead of writing to file if single source file is processed"}.`,` -q, --quiet ${h.optionDesc_quiet||"Suppress all logging except errors"}.`],paramOptions:[`
27
- ${d}o ${h.helpSection_paramOptions||"Parameter options"}:`,`--ignore-files="file1.js,file2.js" ${h.optionDesc_ignoreFiles||"Files to exclude from minification"}.`,`--comment="comment" ${h.optionDesc_commentMain||"Prepend header comment to minified code"}.`+` ${h.optionDesc_commentExtra||"Separate by line using '\\n'"}.`],infoCmds:[`
28
- ${d}o ${h.helpSection_infoCmds||"Info commands"}:`," -h, --help "+(h.optionDesc_help||"Display help screen."),` -v, --version ${h.optionDesc_version||"Show version number"}.`]};e.forEach(t=>{o[t]?.forEach(i=>{{var r=/header|usage/.test(t)?1:37;let o=process.stdout.columns||80,n=[],e=i.match(/\S+|\s+/g),s="";e.forEach(e=>{var i=o-(0==n.length?0:r);s.length+"| ".length+e.length>i&&(n.push(0==n.length?s:s.trimStart()),s=""),s+=e}),n.push(0==n.length?s:s.trimStart()),n.forEach((e,i)=>console.info("| "+(0==i?e:" ".repeat(r)+e)))}})}),console.info(`
29
- ${h.info_moreHelp||"For more help"}, ${h.info_visit||"visit"}: `+d+docURL+a)}function _(){console.info(`
30
- ${h.info_moreHelp||"For more help"},`+` ${h.info_type||"type"} 'minify-js --help'`+` ${h.info_or||"or"} ${h.info_visit||"visit"}
31
- `+d+docURL+a)}function v(e){u.quietMode||console.info(e)}})();
7
+ const pkgName="@adamlui/minify.js",copyright="© 2024–2025 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",latestLocaleCommitHash="55480ff";(async()=>{const o=require(__dirname.match(/src/)?"./minify":"./minify.min"),n=require("fs"),s=require("path"),i=require("node-clipboardy"),t=require("child_process")["execSync"],r="",a="",l="",c="",m="";let f="en";if("win32"==process.platform)try{f=t("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){v("Error loading system language: "+e)}else{var d=process.env;f=(d.LANG||d.LANGUAGE||d.LC_ALL||d.LC_MESSAGES||d.LC_NAME||"en").split(".")[0]}let p={};d=new Promise((t,r)=>{const a=`https://cdn.jsdelivr.net/gh/adamlui/minify.js@4b4ef9ec6a56f685d2f38a4692be638f77fb93e3/_locales/`,e=`${f?f.replace("-","_"):"en"}/`;let l=a+e+"messages.json",c=0;$(l).then(async function i(e){try{const o=await e.json(),n={};for(const s in o)"object"==typeof o[s]&&"message"in o[s]&&(n[s]=o[s].message);t(n)}catch(e){if(3==++c)return t({});$(l=f.includes("-")&&1==c?l.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):a+"en/messages.json").then(i).catch(r)}}).catch(r)});try{p=await d}catch(e){v("Error fetching messages: "+e)}const g={},h={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))$/,noFilenameChange:/^--?(?:X|(?:disable|no)-?(?:file)?name-?change|(?:file)?name-?change=(?:false|0))$/,copy:/^--?c(?:opy)?$/,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,o,n;i.startsWith("-")&&(n=Object.keys(h.flags).find(e=>h.flags[e].test(i)),e=Object.keys(h.paramOptions).find(e=>h.paramOptions[e].test(i)),o=Object.keys(h.infoCmds).find(e=>h.infoCmds[e].test(i)),n?g[n]=!0:e?(/=.+/.test(i)||(console.error(`
8
+ ${a+(p.prefix_error||"ERROR")}: `+`Arg [--${i.replace(/-/g,"")}] `+`${p.error_noEqual||"requires '=' followed by a value"}.${r}`),_(),process.exit(1)),n=i.split("=")[1],g[e]=parseInt(n)||n):o||(console.error(`
9
+ ${a+(p.prefix_error||"ERROR")}: `+`Arg [${i}] ${p.error_notRecognized||"not recognized"}.`),console.info(`
10
+ ${l+(p.info_validArgs||"Valid arguments are below")}.`),y(["flags","paramOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>h.infoCmds.help.test(e)))y();else if(process.argv.some(e=>h.infoCmds.version.test(e))){d=t(`npm view ${pkgName} version`).toString().trim()||"none";let e,i=process.cwd();for(;"/"!=i;){var u=s.join(i,"package.json");if(n.existsSync(u)){u=require(u);e=(u.dependencies?.[pkgName]||u.devDependencies?.[pkgName])?.match(/^\d+\.\d+\.\d+$/)?.[0]||"none";break}i=s.dirname(i)}console.info(`
11
+ ${p.prefix_globalVer||"Global version"}: `+d),console.info(`${p.prefix_localVer||"Local version"}: `+e)}else{const[j="",S=""]=process.argv.slice(2).filter(e=>!e.startsWith("-")).map(e=>e.replace(/^\/*/,""));let e=s.resolve(process.cwd(),j);j&&!n.existsSync(e)&&(d=e+".js",n.existsSync(d)?e=d:(console.error(`
12
+ ${a+(p.prefix_error||"ERROR")}: `+`${p.error_firstArgNotExist||"First argument can only be an existing file or directory"}.`+`
13
+ ${e} ${p.error_doesNotExist||"does not exist"}.`),console.info(`
14
+ ${c}${p.info_exampleValidCmd||"Example valid command"}: `+`
15
+ » minify-js . output.min.js`),_(),process.exit(1)));d=e.endsWith(".js")&&!n.statSync(e).isDirectory()?[e]:o.findJS(e,{recursive:!g.noRecursion,verbose:!g.quietMode,ignoreFiles:(g.ignoreFiles?.split(",")??[]).map(e=>e.trim())});if(g.dryRun)0<d.length?(console.info(`
16
+ ${l+(p.info_filesToBeMinned||"JS files to be minified")}:`),d.forEach(e=>console.info(e))):console.info(`
17
+ ${l+(p.info_noFilesWillBeMinned||"No JS files will be minified")}.`);else{const b=[];d=d.map(e=>{var i=o.minify(e,{verbose:!g.quietMode,mangle:!g.noMangle,comment:g.comment?.replace(/\\n/g,"\n")});return i.error&&b.push(e),i}).filter(e=>!e.error);0<d?.length?(v(`
18
+ ${c+(p.info_minComplete||"Minification complete")}!`),v(m+d.length+" "+(p.info_file||"file")+`${1<d.length?"s":""} ${p.info_minified||"minified"}.${r}`)):v(`
19
+ ${l+(p.info_noFilesProcessed||"No unminified JavaScript files processed")}.`),0<b.length&&(v(`
20
+ ${a+b.length} `+(p.info_file||"file")+`${1<b.length?"s":""} ${p.info_failedToMinify||"failed to minify"}:${r}`),b.forEach(e=>v(e))),0!=d?.length&&(g.copy&&1==d?.length?(console.log(`
21
+ `+m+d[0].code+r),v(`
22
+ ${p.info_copying||"Copying to clipboard"}...`),i.writeSync(d[0].code)):(v(`
23
+ ${p.info_writing||"Writing to file"}${1<d?.length?"s":""}...`),d?.forEach(({code:e,srcPath:i})=>{var o=s.join(s.dirname(i),(/so?u?rce?$/.test(s.dirname(i))?"../":"")+(S.endsWith(".js")?s.dirname(S):S||"min")),i=(S.endsWith(".js")&&j.endsWith(".js")?s.basename(S).replace(/(\.min)?\.js$/,""):s.basename(i,".js"))+`${g.noFilenameChange?"":".min"}.js`,i=s.join(o,i);n.existsSync(o)||n.mkdirSync(o,{recursive:!0}),n.writeFileSync(i,e,"utf8")})))}}function $(n){return new Promise((o,e)=>{var i=n.match(/^([^:]+):\/\//)[1];/^https?$/.test(i)||e(new Error(`${p.error_invalidURL||"Invalid URL"}.`)),require(i).get(n,e=>{let i="";e.on("data",e=>i+=e),e.on("end",()=>o({json:()=>JSON.parse(i)}))}).on("error",e)})}function y(e=["header","usage","pathArgs","flags","paramOptions","infoCmds"]){var i=` ${pkgName.replace(/^@[^/]+\//,"")}  `;const o={header:["\n├ "+i+(p.appCopyright||copyright),i+(p.prefix_source||"Source")+": "+srcURL],usage:[`
24
+ ${m}o ${p.helpSection_usage||"Usage"}:`,` ${m}» `+c+cmdFormat+r],pathArgs:[`
25
+ ${m}o ${p.helpSection_pathArgs||"Path arguments"}:`," [inputPath] "+`${p.inputPathDesc_main||"Path to JS file or directory containing JS files to be minified"}, `+`${p.inputPathDesc_extra||"relative to the current working directory"}.`," [outputPath] "+`${p.outputPathDesc_main||"Path to file or directory where minified files will be stored"}, `+`${p.outputPathDesc_extra||"relative to original file location (if not provided, min/ is used)"}.`],flags:[`
26
+ ${m}o ${p.helpSection_flags||"Boolean options"}:`," -n, --dry-run "+`${p.optionDesc_dryRun||"Don't actually minify the file(s), just show if they will be processed"}.`,` -d, --include-dotfolders ${p.optionDesc_dotfolders||"Include dotfolders in file search"}.`,` -D, --include-dotfiles ${p.optionDesc_dotfiles||"Include dotfiles in file search"}.`,` -R, --no-recursion ${p.optionDesc_noRecursion||"Disable recursive file searching"}.`,` -M, --no-mangle ${p.optionDesc_noMangle||"Disable mangling names"}.`," -X, --no-filename-change "+(p.optionDesc_noFilenameChange||"Disable changing file extension to .min.js"),` -c, --copy ${p.optionDesc_copy||"Copy minified code to clipboard instead of writing to file if single source file is processed"}.`,` -q, --quiet ${p.optionDesc_quiet||"Suppress all logging except errors"}.`],paramOptions:[`
27
+ ${m}o ${p.helpSection_paramOptions||"Parameter options"}:`,`--ignore-files="file1.js,file2.js" ${p.optionDesc_ignoreFiles||"Files to exclude from minification"}.`,`--comment="comment" ${p.optionDesc_commentMain||"Prepend header comment to minified code"}.`+` ${p.optionDesc_commentExtra||"Separate by line using '\\n'"}.`],infoCmds:[`
28
+ ${m}o ${p.helpSection_infoCmds||"Info commands"}:`," -h, --help "+(p.optionDesc_help||"Display help screen."),` -v, --version ${p.optionDesc_version||"Show version number"}.`]};e.forEach(r=>o[r]?.forEach(e=>{{var n=/header|usage/.test(r)?1:37;const s=process.stdout.columns||80,t=[],i=e.match(/\S+|\s+/g);let o="";i.forEach(e=>{var i=s-(t.length?n:0);o.length+"| ".length+e.length>i&&(t.push(t.length?o.trimStart():o),o=""),o+=e}),t.push(t.length?o.trimStart():o),t.forEach((e,i)=>console.info("| "+(0==i?e:" ".repeat(n)+e)))}})),console.info(`
29
+ ${p.info_moreHelp||"For more help"}, ${p.info_visit||"visit"}: `+m+docURL+r)}function _(){console.info(`
30
+ ${p.info_moreHelp||"For more help"}, ${p.info_type||"type"} minify-js --help' ${p.info_or||"or"} ${p.info_visit||"visit"}
31
+ `+m+docURL+r)}function v(e){g.quietMode||console.info(e)}})();
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * © 2023–2024 Adam Lui & contributors under the MIT license.
3
+ * © 2023–2025 Adam Lui & contributors under the MIT license.
4
4
  * Source: https://code.minify-js.org/node.js
5
5
  * Documentation: https://docs.minify-js.org/node.js
6
6
  */
7
- let fs=require("fs"),path=require("path"),uglifyJS=require("uglify-js");function findJS(r,n={}){var e="https://docs.minify-js.org/node.js/#findjssearchdir-options",i={recursive:!0,verbose:!0,dotFolders:!1,dotFiles:!1,ignoreFiles:[]};if("string"!=typeof r)console.error("findJS() » ERROR: 1st arg <searchDir> must be a string."),console.info("findJS() » For more help, please visit "+e);else{var o=path.resolve(process.cwd(),r);if(fs.existsSync(o)){if(validateOptions(n,i,e,"findJS('assets/js', { verbose: false, dotFoldes: true })")){n={...i,...n};let e=fs.readdirSync(r),o=[];return n.verbose&&!n.isRecursing&&console.info("findJS() » Searching for unminified JS files..."),e.forEach(e=>{var i=path.resolve(r,e);fs.statSync(i).isDirectory()&&"node_modules"!=e&&n.recursive&&(n.dotFolders||!e.startsWith("."))?o.push(...findJS(i,{...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]`):o.push(i)}),n.verbose&&!n.isRecursing&&(console.info("findJS() » Search complete! "+(0==o.length?"No":o.length)+` file${1==o.length?"":"s"} found.`),"minify"!=findJS.caller.name)&&"undefined"!=typeof window&&console.info("findJS() » Check returned array."),n.isRecursing||0<o.length?o:[]}}else console.error("findJS() » ERROR: 1st arg <searchDir> must be an existing directory."),console.error(`findJS() » ${o} does not exist.`),console.info("findJS() » For more help, please visit "+e)}}function minify(e,r={}){var i="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 "+i);else if(validateOptions(r,n,i,"minify('assets/js', { recursive: false, mangle: false })")){let o={mangle:!!(r={...n,...r}).mangle&&{toplevel:!1}};return fs.existsSync(e)?e.endsWith(".js")?(r.verbose&&console.info(`minify() » ** Minifying ${e}...`),i=uglifyJS.minify(fs.readFileSync(e,"utf8"),o),r.comment&&(i.code=s(i.code,r.comment)),i.error?console.error("minify() » ERROR: "+i.error.message):r.verbose&&"undefined"!=typeof window&&console.info("minify() » Minification complete! Check returned object."),{code:i.code,srcPath:path.resolve(process.cwd(),e),error:i.error}):(n=findJS(e,{recursive:r.recursive,verbose:r.verbose,dotFolders:r.dotFolders,dotFiles:r.dotFiles,ignoreFiles:r.ignoreFiles})?.map(e=>{r.verbose&&console.info(`minify() » ** Minifying ${e}...`);var i=fs.readFileSync(e,"utf8"),i=uglifyJS.minify(i,o);return r.comment&&(i.code=s(i.code,r.comment)),i.error&&console.error("minify() » ERROR: "+i.error.message),{code:i.code,srcPath:e,error:i.error}}).filter(e=>!e.error),r.verbose&&(0<n.length&&"undefined"!=typeof window?console.info("minify() » Minification complete! Check returned object."):console.info("minify() » No unminified JavaScript files processed.")),n):(r.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » ** Minifying passed source code..."),i=uglifyJS.minify(e,o),r.comment&&(i.code=s(i.code,r.comment)),i.error?console.error("minify() » ERROR: "+i.error.message):r.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » Minification complete! Check returned object."),{code:i.code,srcPath:void 0,error:i.error});function s(e,i){var i=i.split("\n").map(e=>" * "+e).join("\n"),o=e.indexOf("#!");return 0<=o?(o=e.indexOf("\n",o)+1,e.slice(0,o)+`/**
7
+ const fs=require("fs"),path=require("path"),uglifyJS=require("uglify-js");function findJS(o,n={}){var e="https://docs.minify-js.org/node.js/#findjssearchdir-options",i={recursive:!0,verbose:!0,dotFolders:!1,dotFiles:!1,ignoreFiles:[]};if("string"!=typeof o)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(),o);if(fs.existsSync(r)){if(validateOptions(n,i,e,"findJS('assets/js', { verbose: false, dotFoldes: true })")){n={...i,...n};const s=fs.readdirSync(o),t=[];return n.verbose&&!n.isRecursing&&console.info("findJS() » Searching for unminified JS files..."),s.forEach(e=>{var i=path.resolve(o,e);fs.statSync(i).isDirectory()&&"node_modules"!=e&&n.recursive&&(n.dotFolders||!e.startsWith("."))?t.push(...findJS(i,{...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(i)}),n.verbose&&!n.isRecursing&&(console.info("findJS() » Search complete! "+(0==t.length?"No":t.length)+` file${1==t.length?"":"s"} found.`),"minify"!=findJS.caller.name)&&"undefined"!=typeof window&&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,o={}){var i="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 "+i);else if(validateOptions(o,n,i,"minify('assets/js', { recursive: false, mangle: false })")){const s={mangle:!!(o={...n,...o}).mangle&&{toplevel:!1}};return fs.existsSync(e)?e.endsWith(".js")?(o.verbose&&console.info(`minify() » ** Minifying ${e}...`),i=uglifyJS.minify(fs.readFileSync(e,"utf8"),s),o.comment&&(i.code=r(i.code,o.comment)),i.error?console.error("minify() » ERROR: "+i.error.message):o.verbose&&"undefined"!=typeof window&&console.info("minify() » Minification complete! Check returned object."),{code:i.code,srcPath:path.resolve(process.cwd(),e),error:i.error}):(n=findJS(e,{recursive:o.recursive,verbose:o.verbose,dotFolders:o.dotFolders,dotFiles:o.dotFiles,ignoreFiles:o.ignoreFiles})?.map(e=>{o.verbose&&console.info(`minify() » ** Minifying ${e}...`);var i=fs.readFileSync(e,"utf8"),i=uglifyJS.minify(i,s);return o.comment&&(i.code=r(i.code,o.comment)),i.error&&console.error("minify() » ERROR: "+i.error.message),{code:i.code,srcPath:e,error:i.error}}).filter(e=>!e.error),o.verbose&&(0<n.length&&"undefined"!=typeof window?console.info("minify() » Minification complete! Check returned object."):console.info("minify() » No unminified JavaScript files processed.")),n):(o.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » ** Minifying passed source code..."),i=uglifyJS.minify(e,s),o.comment&&(i.code=r(i.code,o.comment)),i.error?console.error("minify() » ERROR: "+i.error.message):o.verbose&&!process.argv.some(e=>e.includes("gulp"))&&console.info("minify() » Minification complete! Check returned object."),{code:i.code,srcPath:void 0,error:i.error});function r(e,i){var i=i.split("\n").map(e=>" * "+e).join("\n"),o=e.indexOf("#!");return 0<=o?(o=e.indexOf("\n",o)+1,e.slice(0,o)+`/**
8
8
  ${i}
9
9
  */
10
10
  `+e.slice(o)):`/**
11
11
  ${i}
12
12
  */
13
- `+e}}}function validateOptions(e,i,o,r){let n=JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),s=Object.keys(i).join(", "),t=Object.keys(i).filter(e=>"boolean"==typeof i[e]),l=Object.keys(i).filter(e=>Number.isInteger(i[e])),c=Object.keys(i).filter(e=>Array.isArray(i[e])),f="validateOptions() » ";try{f=validateOptions.caller?.name+"() » "}catch(e){}var d,a=r.split(",").findIndex(e=>e.trim().startsWith("{"))+1,m=(a+=["st","nd","rd"][a-1]||"th",()=>{console.info(`${f}Valid options: [ ${s} ]`),console.info(f+"If omitted, default settings are: "+n)}),u=()=>{console.info(f+"For more help, please visit "+o)};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: "+r),m(),u(),!1;for(d in e){if("isRecursing"!=d&&!Object.prototype.hasOwnProperty.call(i,d))return console.error(`${f}ERROR: \`${d}\` is an invalid option.`),m(),u(),!1;if(t.includes(d)&&"boolean"!=typeof e[d])return console.error(`${f}ERROR: [${d}] option can only be \`true\` or \`false\`.`),u(),!1;if(l.includes(d)){if(e[d]=parseInt(e[d],10),isNaN(e[d])||e[d]<1)return console.error(`${f}ERROR: [${d}] option can only be an integer > 0.`),u(),!1}else if(c.includes(d))if("string"!=typeof e[d]||e[d].includes(",")){if(!Array.isArray(e[d]))return console.error(`${f}ERROR: [${d}] option can only be an array.`),u(),!1}else e[d]=[e[d]]}return!0}let mjsAliases={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(let i in mjsAliases)mjsAliases[i].forEach(e=>module.exports[e]=module.exports[i]);
13
+ `+e}}}function validateOptions(e,i,o,n){const r=JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),s=Object.keys(i).join(", "),t=Object.keys(i).filter(e=>"boolean"==typeof i[e]),l=Object.keys(i).filter(e=>Number.isInteger(i[e])),c=Object.keys(i).filter(e=>Array.isArray(i[e])),f=`${validateOptions.caller?.name||"validateOptions"}() » `;var d=n.split(",").findIndex(e=>e.trim().startsWith("{"))+1,a=(d+=["st","nd","rd"][d-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 "+o)};if("object"!=typeof e)return console.error(f+`ERROR: ${"0th"==d?"[O":d+" arg [o"}ptions] can only be an object of key/values.`),console.info(f+"Example valid call: "+n),a(),m(),!1;for(const u in e){if("isRecursing"!=u&&!Object.prototype.hasOwnProperty.call(i,u))return console.error(f+`ERROR: \`${u}\` is an invalid option.`),a(),m(),!1;if(t.includes(u)&&"boolean"!=typeof e[u])return console.error(f+`ERROR: [${u}] option can only be \`true\` or \`false\`.`),m(),!1;if(l.includes(u)){if(e[u]=parseInt(e[u],10),isNaN(e[u])||e[u]<1)return console.error(f+`ERROR: [${u}] option can only be an integer > 0.`),m(),!1}else if(c.includes(u))if("string"!=typeof e[u]||e[u].includes(",")){if(!Array.isArray(e[u]))return console.error(f+`ERROR: [${u}] option can only be an array.`),m(),!1}else e[u]=[e[u]]}return!0}const mjsAliases={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 Y in mjsAliases)mjsAliases[Y].forEach(e=>module.exports[e]=module.exports[Y]);
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://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">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.minify-js.org/images/icons/earth/white/icon32.svg?v=ad67551">
5
+ <img height=14 src="https://assets.minify-js.org/images/icons/earth/black/icon32.svg?v=ad67551">
6
6
  </picture>
7
7
  &nbsp;English |
8
8
  <a href="zh-cn/LICENSE.md">简体中文</a> |
@@ -19,7 +19,7 @@
19
19
 
20
20
  # 🏛️ MIT License
21
21
 
22
- **Copyright © 2023–2024 [Adam Lui](https://github.com/adamlui) & contributors.**
22
+ **Copyright © 2023–2025 [Adam Lui](https://github.com/adamlui) & contributors.**
23
23
 
24
24
  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:
25
25
 
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://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">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.minify-js.org/images/icons/earth/white/icon32.svg?v=ad67551">
5
+ <img height=14 src="https://assets.minify-js.org/images/icons/earth/black/icon32.svg?v=ad67551">
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> |
@@ -21,19 +21,26 @@
21
21
 
22
22
  ### Recursively minify all JavaScript files.
23
23
 
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
- <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.8.4"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.4-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
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
- <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
- <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
- <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>
24
+ <a href="https://www.npmjs.com/package/@adamlui/minify.js">
25
+ <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>
26
+ <a href="#%EF%B8%8F-mit-license">
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/minify.js/releases/tag/node-v1.8.6">
29
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.6-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
30
+ <a href="https://www.npmjs.com/package/@adamlui/minify.js?activeTab=code">
31
+ <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>
32
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_minify.js:node.js/src/minify.js">
33
+ <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>
34
+ <a href="https://github.com/toolleeo/cli-apps#programming">
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>
36
+ <a href="https://minify-js.org">
37
+ <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
38
 
32
39
  <img src="https://cdn.jsdelivr.net/gh/adamlui/minify.js@3d56890/node.js/media/images/screenshots/cli/minify-js-docs-cmd-output.png">
33
40
 
34
41
  <br>
35
42
 
36
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
43
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
37
44
 
38
45
  ## ⚡ Installation
39
46
 
@@ -57,9 +64,9 @@ $ npm install @adamlui/minify.js
57
64
 
58
65
  <br>
59
66
 
60
- <a href="https://github.com/sponsors/adamlui"><img src="https://media.minify-js.org/images/banners/sponsor/$10/banner1660x260.png?f6118ce"></a>
67
+ <a href="https://github.com/sponsors/adamlui"><img src="https://assets.minify-js.org/images/banners/sponsor/$10/banner1660x260.png?v=63bbeed"></a>
61
68
 
62
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
69
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
63
70
 
64
71
  ## 💻 Command line usage
65
72
 
@@ -154,7 +161,7 @@ Info commands:
154
161
 
155
162
  <br>
156
163
 
157
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
164
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
158
165
 
159
166
  ## 🔌 API usage
160
167
 
@@ -259,11 +266,11 @@ Name | Type | Desciption
259
266
 
260
267
  <br>
261
268
 
262
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
269
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
263
270
 
264
271
  ## 🏛️ MIT License
265
272
 
266
- **Copyright © 2023–2024 [Adam Lui](https://github.com/adamlui) & contributors.**
273
+ **Copyright © 2023–2025 [Adam Lui](https://github.com/adamlui) & contributors.**
267
274
 
268
275
  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:
269
276
 
@@ -273,30 +280,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
273
280
 
274
281
  <br>
275
282
 
276
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
283
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
277
284
 
278
285
  ## 🛠️ Related utilities
279
286
 
280
- ### [</> minify.js (Gulp)](https://gulp.minify-js.org) &nbsp;<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>
287
+ ### [</> minify.js (Gulp)](https://gulp.minify-js.org) &nbsp;<a href="https://github.com/toolleeo/cli-apps#programming"><img height=18 src="https://assets.minify-js.org/images/badges/awesome/badge.svg?v=63bbeed"></a>
281
288
 
282
289
  > Gulp plug-in to recursively minify all JavaScript files.
283
290
  <br>[Install](https://gulp.minify-js.org/#-installation) /
284
291
  [Readme](https://gulp.minify-js.org/#readme) /
285
- [Discuss](https://github.minify-js.org/discussions)
292
+ [Discuss](https://github.com/adamlui/minify.js/discussions)
286
293
 
287
- ### [{ } scss-to-css](https://github.com/adamlui/scss-to-css) &nbsp;<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>
294
+ ### [{ } scss-to-css](https://scsstocss.org) &nbsp;<a href="https://github.com/toolleeo/cli-apps#conversion"><img height=18 src="https://assets.minify-js.org/images/badges/awesome/badge.svg?v=63bbeed"></a>
288
295
 
289
296
  > Recursively compile all SCSS files into minified CSS.
290
297
  <br>[Install](https://node.scsstocss.org/#-installation) /
291
298
  [Readme](https://node.scsstocss.org/#readme) /
292
299
  [CLI usage](https://node.scsstocss.org/#-command-line-usage) /
293
300
  [API usage](https://node.scsstocss.org/#-api-usage) /
294
- [Discuss](https://github.scsstocss.org/discussions)
301
+ [Discuss](https://github.com/adamlui/scss-to-css/discussions)
295
302
 
296
303
  <br>
297
304
 
298
- <img height=6px width="100%" src="https://media.minify-js.org/images/separators/gradient-aqua.png?8b9ed02">
305
+ <img height=6px width="100%" src="https://assets.minify-js.org/images/separators/aqua-gradient.png?v=ad67551">
299
306
 
300
- <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> /
301
- <a href="https://github.minify-js.org/discussions">Discuss</a> /
307
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.minify-js.org/images/icons/home/white/icon32x27.png?v=ad67551"><img height=13 src="https://assets.minify-js.org/images/icons/home/dark-gray/icon32x27.png?v=ad67551"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
308
+ <a href="https://github.com/adamlui/minify.js/discussions">Discuss</a> /
302
309
  <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://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">
4
+ <source type="image/svg+xml" media="(prefers-color-scheme: dark)" srcset="https://assets.minify-js.org/images/icons/earth/white/icon32.svg?v=ad67551">
5
+ <img height=14 src="https://assets.minify-js.org/images/icons/earth/black/icon32.svg?v=ad67551">
6
6
  </picture>
7
7
  &nbsp;English |
8
8
  <a href="zh-cn/SECURITY.md">简体中文</a> |
@@ -19,6 +19,4 @@
19
19
 
20
20
  # 🛡️ Security Policy
21
21
 
22
- If you find a vulnerability, please open a [draft security advisory](https://github.minify-js.org/security/advisories/new).
23
-
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.
22
+ 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": "@adamlui/minify.js",
3
- "version": "1.8.4",
3
+ "version": "1.8.6",
4
4
  "description": "Recursively minify all JavaScript files",
5
5
  "author": {
6
6
  "name": "Adam Lui",
@@ -9,6 +9,16 @@
9
9
  },
10
10
  "homepage": "https://minify-js.org",
11
11
  "license": "MIT",
12
+ "funding": [
13
+ {
14
+ "type": "github",
15
+ "url": "http://github.com/sponsors/adamlui"
16
+ },
17
+ {
18
+ "type": "ko-fi",
19
+ "url": "https://ko-fi.com/adamlui"
20
+ }
21
+ ],
12
22
  "main": "dist/minify.min.js",
13
23
  "files": [
14
24
  "docs/",
@@ -29,10 +39,7 @@
29
39
  "bump:patch": "bash utils/bump.sh patch",
30
40
  "bump:minor": "bash utils/bump.sh minor",
31
41
  "bump:major": "bash utils/bump.sh major",
32
- "prepublishOnly": "npm test",
33
- "publish:patch": "bash utils/bump.sh patch --publish",
34
- "publish:minor": "bash utils/bump.sh minor --publish",
35
- "publish:major": "bash utils/bump.sh major --publish"
42
+ "prepublishOnly": "npm test"
36
43
  },
37
44
  "repository": {
38
45
  "type": "git",
@@ -49,14 +56,10 @@
49
56
  "utils"
50
57
  ],
51
58
  "bugs": {
52
- "url": "https://github.minify-js.org/issues"
59
+ "url": "https://support.minify-js.org"
53
60
  },
54
61
  "dependencies": {
55
62
  "node-clipboardy": "^1.0.3",
56
- "uglify-js": "^3.19.2"
57
- },
58
- "funding": {
59
- "type": "github",
60
- "url": "https://github.com/sponsors/adamlui"
63
+ "uglify-js": "^3.19.3"
61
64
  }
62
65
  }