From: XhmikosR Date: Thu, 31 Jul 2014 17:06:54 +0000 (+0300) Subject: Update README.md. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=399d3389428f849b2d7815271bff74ff0d48a28e;p=html-minifier.git Update README.md. --- diff --git a/README.md b/README.md index 24fbd52..1267ac2 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ How does HTMLMinifier compare to [another solution](http://www.willpeavy.com/min | Site | Original size _(KB)_ | HTMLMinifier _(KB)_ | Will Peavy _(KB)_ | htmlcompressor.com _(KB)_ | | --------------------------------------------------------------------------- |:-----------:| ----------------:| ------------:| ----------------:| | [HTMLMinifier page](https://github.com/kangax/html-minifier) | 48.8 | 37.3 | 43.3 | 41.9 | -| [ES6 table](http://kangax.github.io/es5-compat-table/es6/) | 117.9 | 79.9 | 92 | 91.9 | +| [ES6 table](http://kangax.github.io/es5-compat-table/es6/) | 117.9 | 79.9 | 92 | 91.9 | | [MSN](http://msn.com) | 156.6 | 133 | 145 | 138.3 | | [Stackoverflow](http://stackoverflow.com) | 200.4 | 159.5 | 168.3 | 163.3 | -| [Amazon](http://amazon.com) | 245.9 | 206.3 | 225 | 218.5 | +| [Amazon](http://amazon.com) | 245.9 | 206.3 | 225 | 218.5 | | [Wikipedia](http://en.wikipedia.org/wiki/President_of_the_United_States) | 401.4 | 380.6 | 396.3 | n/a | | [Eloquent Javascript](http://eloquentjavascript.net/print.html) | 869.5 | 830 | 872 | n/a | @@ -46,42 +46,41 @@ How does HTMLMinifier compare to [another solution](http://www.willpeavy.com/min | `caseSensitive` | Treat attributes in case sensitive manner (useful for SVG; e.g. viewBox) | `false` | | `minifyJS` | Minify Javascript in script elements and on* attributes (uses [UglifyJS](https://github.com/mishoo/UglifyJS2)) | `false` (could be `true`, `false`, `Object` (options)) | | `minifyCSS` | Minify CSS in style elements and style attributes (uses [clean-css](https://github.com/GoalSmashers/clean-css)) | `false` (could be `true`, `false`, `Object` (options)) | -| `ignoreCustomComments` | Array of regex'es that allow to ignore certain comments, when matched | `[ ]` | -| `processScripts` | Array of strings corresponding to types of script elements to process through minifier (e.g. "text/ng-template", "text/x-handlebars-template", etc.) | `[ ]` | +| `ignoreCustomComments` | Array of regex'es that allow to ignore certain comments, when matched | `[ ]` | +| `processScripts` | Array of strings corresponding to types of script elements to process through minifier (e.g. "text/ng-template", "text/x-handlebars-template", etc.) | `[ ]` | | `maxLineLength` | Specify a maximum line length. Compressed output will be split by newlines at valid html split-points. | -| `customAttrAssign` | `[ ]` | Arrays of regex'es that allow to support custom attribute assign expressions (e.g. `'
'`) | -| `customAttrSurround` | `[ ]` | Arrays of regex'es that allow to support custom attribute surround expressions (e.g. ``) | +| `customAttrAssign` | `[ ]` | Arrays of regex'es that allow to support custom attribute assign expressions (e.g. `'
'`) | +| `customAttrSurround` | `[ ]` | Arrays of regex'es that allow to support custom attribute surround expressions (e.g. ``) | Chunks of markup can be ignored by wrapping them with ``. -Installation Instructions -------------------------- +## Installation Instructions From NPM for use as a command line app: -``` +```bash npm install html-minifier -g ``` From NPM for programmatic use: -``` +```bash npm install html-minifier ``` From Git: -``` +```bash git clone git://github.com/kangax/html-minifier.git cd html-minifier npm link . ``` -Usage --------- +## Usage + For command line usage please see `html-minifier --help` -Node.js -======== -``` +### Node.js + +```js var minify = require('html-minifier').minify; var result = minify('

foo

', { removeAttributeQuotes: true