gulp-size2
v0.4.0
Published
Display the size of your project
Downloads
177
Maintainers
Readme
gulp-size
Display the size of your project
Logs out the total size of files in the stream and optionally the individual file-sizes.
Install
$ npm install --save-dev gulp-size2
Usage
var gulp = require('gulp');
var size = require('gulp-size2');
gulp.task('default', function () {
return gulp.src('fixture.js')
.pipe(size())
.pipe(gulp.dest('dist'));
});
API
size(options)
options
showFiles
Type: boolean
Default: false
Displays the size of every file instead of just the total size.
gzip
Type: boolean
Default: false
Displays the gzipped size instead.
title
Type: string
Default: ''
Give it a title so it's possible to distinguish the output of multiple instances logging at once.
log
Type: function
Customize log info if you want.
gulp.size({
log: function(title, what, size, gzip) {
console.log(title, what, size, gzip);
}
})