Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

smosh

1.2.0 • Public • Published

smosh Build Status

A middleware between resmushit and streams on top of vinyl.

How to use?

npm install smosh --save
var smosh = require('smosh'),
    file  = smosh(vinylFile),
    data  = '';
 
file.on('data', function(chunk) {
    // file chunk stream
    data += chunk;
});
 
file.on('end', function(newBuffer, info) {
    // vinyl metadata if previously given
    console.log(newBuffer.toString());
    // or if data is streamed
    console.log(data);
    // percentage compressed
    console.log(info.percent)
});
 
file.on('error', function(err) {
    throw err;
});

License

MIT © Helder Santana

Based on: node-smushit

install

npm i smosh

Downloadsweekly downloads

422

version

1.2.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar