https://github.com/goto-bus-stop/html-minify-stream
minify html in a stream using html-minifier.
https://github.com/goto-bus-stop/html-minify-stream
html html-minifier minify stream
Last synced: 12 months ago
JSON representation
minify html in a stream using html-minifier.
- Host: GitHub
- URL: https://github.com/goto-bus-stop/html-minify-stream
- Owner: goto-bus-stop
- License: mit
- Created: 2017-10-09T21:20:41.000Z (over 8 years ago)
- Default Branch: default
- Last Pushed: 2023-05-31T04:59:22.000Z (about 3 years ago)
- Last Synced: 2025-06-10T07:53:43.739Z (about 1 year ago)
- Topics: html, html-minifier, minify, stream
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# html-minify-stream
minify html in a stream using html-minifier.
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]
[npm-image]: https://img.shields.io/npm/v/html-minify-stream.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/html-minify-stream
[travis-image]: https://img.shields.io/travis/goto-bus-stop/html-minify-stream.svg?style=flat-square
[travis-url]: https://travis-ci.org/goto-bus-stop/html-minify-stream
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard
## Install
```
npm install html-minify-stream
```
## Usage
```js
var htmlMinifyStream = require('html-minify-stream')
fs.createReadStream('index.html')
.pipe(htmlMinifyStream({
collapseWhitespace: true,
removeOptionalTags: true
}))
.pipe(fs.createWriteStream('dist/index.html'))
```
## API
### `htmlMinifyStream(?options)`
Create a new minify stream. Write an html document to it. `options` is an
options object for [html-minifier](https://github.com/kangax/html-minifier).
## License
[MIT](LICENSE.md)