$ npm install node-minify
A very light minifier Node.js module.
It allow you to compress JavaScript, CSS and HTML files.
JavaScript:
CSS:
HTML:
Command Line Interface:
npm install node-minify # OR yarn add node-minify
var compressor = require('node-minify');
// Using Google Closure Compiler
compressor.minify({
compressor: 'gcc',
input: 'foo.js',
output: 'bar.js',
callback: function(err, min) {}
});
// Using UglifyJS with wildcards
compressor.minify({
compressor: 'uglifyjs',
input: './**/*.js',
output: 'bar.js',
callback: function(err, min) {}
});
// With Promise
var promise = compressor.minify({
compressor: 'uglifyjs',
input: './**/*.js',
output: 'bar.js'
});
promise.then(function(min) {});
Visit https://node-minify.2clics.net for full documentation
Since v0.5.0, a windows support is available for the no-compress option and uglify-js (thanks to pieces029 and benpusherhq)
© 2010 - cnpmjs.org x YWFE | Home | YWFE