Skip to content

Simple, clean API for minifying Javascript, HTML or CSS.

Notifications You must be signed in to change notification settings

direktspeed-server/minify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minify

Is a API Wrapper for HTML, CSS, JS, IMAGE Minifyers

Importent Note

This Should maybe not get used and so we depricate it in favor of the nativ minifyers. we come to the conclusion that this api wrapper doubles logic

Offering a Super clean API for minifying Javascript, HTML or CSS. So you don't have to keep googling for the right tool or the tool’s API. And so that you get a nice CLI regardless.

This is Harp’s fork, which is nearly identical to the original. The differences are:

  • It’s published to npm, to remove the dependency on GitHub for installing
  • It has more up-to-date dependencies
  • It has npm run scripts for development

Installation

npm install harp-minify

CLI

Usage: minify [<input>] [<output>]

Options:

  -h, --help     output usage information
  -V, --version  output the version number

Examples:

  # pass an input and output file
  $ minify input.css output.css

  # use stdin and stdout
  $ cat input.css | myth | minify > output.css

Node

var minify = require('minify');

// choose javascript, html or css
var js = minify.js('js string');
var html = minify.html('html string');
var css = minify.css('css string');

// or pass an unknown string
var min = minify('unknown string');

When using JavaScript, you may also alter the default options using the same API as UglifyJS:

var js = minify.js('js string', {
  compress: false,
  mangle: false
});

License

The MIT License (MIT) => Apache-2.0 from 2016

Copyright © 2013–2015, Ian Storm Taylor <ian@ianstormtaylor.com>
Copyright © 2015 Chloi Inc.>
Copyright © 2016-2019 Frank Lemanschik

About

Simple, clean API for minifying Javascript, HTML or CSS.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 96.3%
  • Makefile 3.7%