Skip to content
/ smosh Public
forked from colorhook/node-smushit

A middleware between resmushit and streams on top of vinyl.

Notifications You must be signed in to change notification settings

heldr/smosh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A middleware between resmushit and streams on top of vinyl.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%