a reshape plugin that pretty-prints your html
npm install reshape-beautify



A reshape plugin that pretty-prints your html
> Note: This project is in early development, and versioning is a little different. Read this for more details.
npm install reshape-beautify --save
> Note: This project is compatible with node v6+ only
Add it as a reshape plugin:
``js
const reshape = require('reshape')
const beautify = require('reshape-beautify')
reshape({ plugins: beautify(/ options /) })
.process(htmlString)
.then((res) => console.log(res.output()))
`
...and that's it! You can specify any options as listed below to customize the behavior.
This plugin will ensure that all tags are correctly indented. However, it will not make changes to any tag that contains a plain text node, because this could interfere with the way the content looks. For example, this crappy html:
` hi therehtml`
Would be transformed as such:
` hi therehtml`
Wow, so clean! It will do the same for minified html:
` hi therehtml`this is minified
Is transformed to:
` hi therehtml`
this is minified
However, if you have something like this:
`html`
hello there!
this is great
We won't alter the spaces inside your section content, because this would change the way it looks on the page, so it would turn out exactly the same as the input.
| Name | Description | Default |
| ---- | ----------- | ------- |
| indent | Number of spaces to indent your elements | 2` |
- Details on the license can be found here
- Details on running tests and contributing can be found here