sizeist
v1.0.1
Published
takes a readable stream and emits its size (in bytes) at various stages of compression
Downloads
134
Readme
sizeist
sizeist takes a readable stream and emits its size (in bytes) at various stages of compression. This is useful for quickly determining the real-world size of a given module.
Install
$ npm install sizeist
Usage
var fs = require('fs')
var sizeist = require('sizeist')
function log (type) {
return console.log.bind(console, type)
}
sizeist(fs.createReadStream('usage.js'))
.on('size', log('size'))
.on('size:uglify', log('size:uglify'))
.on('size:uglify:gzip', log('size:uglify:gzip'))
.on('finish', log('done'))
// Output:
// size 387
// size:uglify 273
// size:uglify:gzip 168
// done