minify-all-js-single-quote

0.1.3 • Public • Published

minify-all-js-single-quote

A function that minifies your javascript files (recursively). minify-all-js-single-quote was designed to reduce the size of your project's node_modules directory. But it can also be used to minify any js files. By giving it a directory, minify-all-js will walk through the depth of your folders and minify all the javascript that it sees.

It's a new version from this package, just adding the quote-style option

Installation

> npm i -g minify-all-js-single-quote

Run CLI

> minify-all-js [folder] [-j] [-m] [-M] [-p]
Sample
> minify-all-js ./node_modules -j -m -M -p

Use CLI options:

  • -j or --json to compress json files as well. (default: false)
  • -m or --module to set terser module option to true for ES6 files (default: false)
  • -M or --mangle to set terser mangle option to true (default: false)
  • -p or --packagejson to clean up extra fields from package.json files (default: false)
  • -a or --all to try to compress all files including binary/executable js files without .js extension (default: false)

Run programatically

  var promise = minifyAllJs([directory], {
    compress_json: true, // -j in cli
    module: true,        // -m in cli
    mangle: true,        // -M in cli
    packagejson: true,   // -p in cli
    all_js: true         // -a in cli
  })

minifyAllJs function returns a promise

Package Sidebar

Install

npm i minify-all-js-single-quote

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

6.17 kB

Total Files

6

Last publish

Collaborators

  • ronaldo-caetano