srod/node-minify


Light Node.js module that compress javascript, css and html files

https://node-minify.2clics.net

License: MIT

Language: JavaScript

Keywords: babel-minify, clean-css, cli, crass, csso, gcc, google-closure-compiler, html, html-minifier, html5, javascript, minify, nodejs, sqwish, terser, uglify-es, uglify-js, yui, yui-compressor


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:

Installation

npm install @node-minify/core # OR yarn add @node-minify/core

And install the compressor you want

npm install @node-minify/uglify-js # OR yarn add @node-minify/uglify-js

Quick Start

const minify = require('@node-minify/core');
const gcc = require('@node-minify/google-closure-compiler');
const uglifyjs = require('@node-minify/uglify-js');

// Using Google Closure Compiler
minify({
  compressor: gcc,
  input: 'foo.js',
  output: 'bar.js',
  callback: function(err, min) {}
});

// Using UglifyJS
minify({
  compressor: uglifyjs,
  input: './**/*.js',
  output: 'bar.js',
  callback: function(err, min) {}
});

// Using Promise
var promise = minify({
  compressor: uglifyjs,
  input: './**/*.js',
  output: 'bar.js'
});

promise.then(function(min) {});

// Async/Await
async function doMinify() {
  const min = await minify({ compressor: uglifyjs, input: 'foo.js', output: 'bar.js' });
}

ES2015+

import minify from '@node-minify/core';
import gcc from '@node-minify/google-closure-compiler';

minify({
  compressor: gcc,
  input: 'foo.js',
  output: 'bar.js',
  callback: function(err, min) {}
});

More examples

Documentation

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

License

MIT

Project Statistics

Sourcerank 17
Repository Size 48.1 MB
Stars 343
Forks 42
Watchers 15
Open issues 3
Dependencies 1,316
Contributors 20
Tags 106
Created
Last updated
Last pushed

Top Contributors See all

Rodolphe Stoclin greenkeeper[bot] greenkeeper[bot] dependabot-bot Greenkeeper dependabot-preview[bot] 腹肌抽筋了 Sebastian Mathias Bynens Alexandru Bardaș Brian Berlin Ted Grubb Nacho Coloma Ahmet Simsek Snyk bot Stefano Ortisi Davorin Šego mendhak azure-pipelines[bot] Emmanuel Vuigner

Packages Referencing this Repo

@node-minify/uglify-es
uglify-es plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/uglify-js
uglify-js plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/utils
utils for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/html-minifier
html-minifier plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/google-closure-compiler
google closure compiler plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/csso
csso plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/cssnano
cssnano plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/cli
CLI - command line interface for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/no-compress
no compress plugin for @node-minify, only concatenate
Latest release 4.1.2 - Updated - 343 stars
@node-minify/core
core of @node-minify
Latest release 4.1.2 - Updated - 343 stars
node-minify-custom-fork
Javascript / CSS minifier based on Babili / YUI Compressor / Google Closure Compiler / UglifyJS2 ...
Latest release 1.0.0 - Published - 343 stars
@node-minify/sqwish
sqwish plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/clean-css
clean-css plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/yui
yui - yahoo compressor plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/crass
crass plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/terser
terser plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
node-minify
Javascript / CSS minifier based on Babel-minify / YUI Compressor / Google Closure Compiler / Ugli...
Latest release 4.0.0-beta.6 - Updated - 343 stars
@node-minify/babel-minify
babel-minify plugin for @node-minify
Latest release 4.1.2 - Updated - 343 stars
@node-minify/run
exec commands for @node-minify
Latest release 4.1.2 - Updated - 343 stars
node-mailer
Mailer on top of nodemailer
Latest release 0.1.1 - Updated - 343 stars

Recent Tags See all

4.1.2 July 15, 2019
4.1.2 July 15, 2019
4.1.1 July 15, 2019
4.1.1 July 15, 2019
4.1.0 January 09, 2019
4.0.5 January 01, 2019
4.0.5 January 01, 2019
4.0.4 December 26, 2018
4.0.3 December 13, 2018
4.0.2 December 13, 2018
4.0.1 November 25, 2018
4.0.0 November 25, 2018
4.0.0-beta.8 November 24, 2018
4.0.0-beta.7 November 16, 2018
4.0.0-beta.6 October 24, 2018

Something wrong with this page? Make a suggestion

Last synced: 2019-07-15 10:50:46 UTC

Login to resync this repository