# html-minifier [TOC] ###### tags: `npm` `cli` --- ## Installation ```shell $ sudo npm i -g html-minifier ``` ## Usage ```shell $ html-minifier \ --collapse-whitespace \ -o dist/projectName/index.html \ dist/projectName/index.html ``` | Option | Description | | ------------------------ | ----------------------------------------------------------------------- | | `--collapse-whitespace` | Collapse white space that contributes to text nodes in a document tree. | | `-o`,`--output` `<file>` | Specify output file (if not specified STDOUT will be used for output). | ## Reference - [npm ยป **html-minifier**](https://www.npmjs.com/package/html-minifier)