js-size
Get the size of some JS.
All sizes are shown gzipped using the gzip-size
module. The gzipped size better represents what gets sent over-the-wire in a production application. It also provides a better baselines when comparing the original to the minified size.
Install
npm install --save js-size
Usage
const jssize =
API
jssize(input, options)
input
Required
Type: string
, buffer
Returns the original
and minified
sizes and the difference
and percent
minified.
jssize.table(input, options)
input
Required
Type: string
, buffer
Returns all the same table but formatted as a cli table.
options (default, {})
es
(default, false)
Whether to use uglify-es
or not.
Uglify options
All other keys are passed directly to uglify
. See the API Reference for available options.
CLI
$ npm install --global js-size
$ js-size Get the size of some JS. Usage js-size <file> cat <file.js> | js-size Options --config, -c Path to json config file to use
License
MIT © Luke Karrys