Light Node.js module that compress javascript and css files with babel-minify / Yui Compressor / Google Closure Compiler / uglify-js / uglify-es / clean-css / CSSO / sqwish
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Readme.md

node-minify

A very light minifier Node.js module.




Features

It allow you to compress JavaScript and CSS files.

Installation

npm install node-minify # OR yarn add node-minify

Quick Start

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) {});

More examples

Documentation

Visit https://node-minify.2clics.net for full documentation

Windows support

Since v0.5.0, a windows support is available for the no-compress option and uglify-js (thanks to pieces029 and benpusherhq)

License

MIT