minifies html by removing extra whitespace and newlines
npm install reshape-minify



A reshape plugin to minify html
> Note: This project is in early development, and versioning is a little different. Read this for more details.
npm install reshape-minify -S
> Note: This project is compatible with node v6+ only
Add it as a plugin to reshape:
``js
const reshape = require('reshape')
const minify = require('reshape-minify')
reshape({ plugins: minify(/ options /) })
.process(someHtml)
.then((res) => {
console.log(res.output(/ locals /))
})
`
#### Options
Options are passed in an object, all are optional.
| Name | Description | Default |
| ---- | ----------- | ------- |
| collapseWhitespace | Removes all extra whitespace | true |false
| conservativeCollapse | Instead of fully removing excess whitespace, collapses down to a single space | |false
| aggressiveCollapse | More aggressive whitespace removal, trims all whitespace from beginning and ends of any text | |true
| removeComments | Removes all comments from the html | |style
| minifyCss | Minifies any CSS in tags | true |script
| minifyJs | Minifies any JS in tags | true |true
| minifySvg | Minifies any inline svg | |script
| minifyJson | Minifies any json in tags with */json as the type | true` |
#### To-Do List
- unquote attributes
- remove trailing zeros on viewport meta
- remove optional parent tags
- minify urls
- Details on the license can be found here
- Details on running tests and contributing can be found here