gulp-size2

Display the size of your project

gulp-size

Display the size of your project

Logs out the total size of files in the stream and optionally the individual file-sizes.

$ npm install --save-dev gulp-size2
var gulp = require('gulp');
var size = require('gulp-size2');
 
gulp.task('default', function () {
    return gulp.src('fixture.js')
        .pipe(size())
        .pipe(gulp.dest('dist'));
});

Type: boolean
Default: false

Displays the size of every file instead of just the total size.

Type: boolean
Default: false

Displays the gzipped size instead.

Type: string
Default: ''

Give it a title so it's possible to distinguish the output of multiple instances logging at once.

Type: function

Customize log info if you want.

gulp.size({
  logfunction(titlewhatsizegzip) {
    console.log(title, what, size, gzip);
  }
})

MIT © Sindre Sorhus