gulp-size2

0.4.0 • Public • Published

gulp-size Build Status

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);
  }
})

License

MIT © Sindre Sorhus

Package Sidebar

Install

npm i gulp-size2

Weekly Downloads

20

Version

0.4.0

License

MIT

Last publish

Collaborators

  • afc163