8000 minify/cmd/minify at master · yellomo/minify · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
 
 

minify

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Minify

Minify is a CLI implemention of the minify library package.

Installation

Make sure you have Go and Git installed.

Run the following command

go get github.com/tdewolff/minify

and the minify command should be in your $GOPATH/bin.

Usage

Usage: minify [options] [file]
Options:
  -o="": Output file (stdout when empty)
  -x="": File extension (html, css or js), optional for input files

Examples

The following commands are variations one can use to minify a file:

$ minify -o file.min.html file.html

$ minify -x css -o file.min.less file.less

$ minify -x js < file.js > file.min.js

$ cat file.html | minify -x html > file.min.html

It is also possible to overwrite the input file by the output file. However, this won't work with input/output redirection streams. Using the following command the input file will be loaded into memory first before writing to the output file:

$ minify -o file.html file.html
0