node-minify

3.6.0 • Public • Published

node-minify

A very light minifier Node.js module.




Features

It allow you to compress JavaScript, CSS and HTML files.

JavaScript:

CSS:

HTML:

Command Line Interface:

  • CLI 🎉 new in version 3

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

Package Sidebar

Install

npm i node-minify

Weekly Downloads

18,028

Version

3.6.0

License

MIT

Unpacked Size

13.7 MB

Total Files

31

Last publish

Collaborators

  • srod