css-purge
Version:
A CSS tool written in Node JS as a command line app or library for the purging, burning, reducing, shortening, compressing, cleaning, trimming and formatting of duplicate, extra, excess or bloated CSS.
24 lines (17 loc) • 390 B
JavaScript
var through2 = require('through2');
var cssPurge = require('./css-purge');
//for streams
function write(buffer, encoding, next) {
cssPurge.purgeCSS(buffer.toString(), {
trim : true,
shorten : true,
verbose : false,
}, function(error, result){
this.push(result);
next();
});
}
function end(done) {
done();
}
process.stdin.pipe(through2(write, end)).pipe(process.stdout);