All Projects → srod → Node Minify

srod / Node Minify

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Minify

Simplifyify
A simplified Browserify and Watchify CLI
Stars: ✭ 37 (-90.84%)
Mutual labels:  minify, cli
Tmuxp
💻 tmux session manager. built on libtmux
Stars: ✭ 3,269 (+709.16%)
Mutual labels:  cli, json
Html Minifier Terser
actively maintained fork of html-minifier - minify HTML, CSS and JS code using terser - supports ES6 code
Stars: ✭ 106 (-73.76%)
Mutual labels:  minify, cli
Octosql
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Stars: ✭ 2,579 (+538.37%)
Mutual labels:  cli, json
Jaggr
JSON Aggregation CLI
Stars: ✭ 365 (-9.65%)
Mutual labels:  cli, json
Cli
A simple, fast, and fun package for building command line apps in Go
Stars: ✭ 16,995 (+4106.68%)
Mutual labels:  cli, json
Sqawk
Like Awk but with SQL and table joins
Stars: ✭ 263 (-34.9%)
Mutual labels:  cli, json
Contentful Cli
The official Contentful command line interface. Use Contentful features straight from the command line!
Stars: ✭ 200 (-50.5%)
Mutual labels:  cli, json
Xidel
Command line tool to download and extract data from HTML/XML pages or JSON-APIs, using CSS, XPath 3.0, XQuery 3.0, JSONiq or pattern matching. It can also create new or transformed XML/HTML/JSON documents.
Stars: ✭ 335 (-17.08%)
Mutual labels:  cli, json
Jwt Cli
A super fast CLI tool to decode and encode JWTs built in Rust
Stars: ✭ 336 (-16.83%)
Mutual labels:  cli, json
Json 2 Csv
Convert JSON to CSV *or* CSV to JSON!
Stars: ✭ 210 (-48.02%)
Mutual labels:  cli, json
Visidata
A terminal spreadsheet multitool for discovering and arranging data
Stars: ✭ 4,606 (+1040.1%)
Mutual labels:  cli, json
Jsonexport
{} → 📄 it's easy to convert JSON to CSV
Stars: ✭ 208 (-48.51%)
Mutual labels:  cli, json
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+13031.68%)
Mutual labels:  cli, json
Rts
RTS: request to struct. Generates Go structs from JSON server responses.
Stars: ✭ 206 (-49.01%)
Mutual labels:  cli, json
Minify
Go minifiers for web formats
Stars: ✭ 2,824 (+599.01%)
Mutual labels:  minify, json
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-53.47%)
Mutual labels:  cli, json
Jl
jl — JSON Logs, a development tool for working with structured JSON logging.
Stars: ✭ 194 (-51.98%)
Mutual labels:  cli, json
Jet
CLI to transform between JSON, EDN and Transit, powered with a minimal query language.
Stars: ✭ 331 (-18.07%)
Mutual labels:  cli, json
Jql
A JSON Query Language CLI tool
Stars: ✭ 368 (-8.91%)
Mutual labels:  cli, json

node-minify

A very light minifier Node.js module.


Build Status

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

In memory

const htmlMinifier = require('@node-minify/html-minifier');

const html = `
<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
    </head>
</html>`;

minify({
  compressor: htmlMinifier,
  content: html
}).then(function(min) {
  console.log('html min');
  console.log(min);
});

More examples

Documentation

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

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].