gulp-print-spacesavings
This Gulp plugin prints space savings for any Gulp compression plugins, like gulp-uglify, gulp-clean-css, etc. Space savings is the reduction in size relative to the uncompressed size.
Space Savings in % = 1 - Compressed Size / Uncompressed Size
See Wikipedia for more information.
Install
$ npm install gulp-print-spacesavings --save-dev
Usage
The plugin has zero configuration. There are two methods init
and print
which should be called before and after any Gulp compression plugin respectively. An example for gulp-clean-css
and gulp-uglify
is shown below.
var gulp = ;var cleanCSS = ;var uglify = ;var printSpaceSavings = ;... gulp; gulp;
The output is displayed in the form of a table.
As you can see, the plugin also displays a footer with total uncompressed, compressed sizes and space savings if there are more than one file.