gulp-bytediff

Compare file sizes before and after your gulp build process.
Install
With npm do:
npm install gulp-bytediff --save-dev
Example
Take any gulpplugin, or series of gulpplugins and see how much the build process added to, or removed from, your filesize. This example uses another of my modules, gulp-cssnano.
var gulp = ;var bytediff = ;var csso = ; gulp;
API
bytediff.start() or bytediff()
Creates a new property on the file object that saves its current size.
bytediff.stop(formatFunction)
Outputs the difference between the property saved with the start()
method
and the current filesize.
Customise the output of this by using the format function. An example:
// ... ;
The function gets passed an object with the following properties:
- fileName
- startSize
- endSize
- savings
- percent
Contributing
Pull requests are welcome. If you add functionality, then please add unit tests to cover it.
License
MIT © Ben Briggs