Skip to content
Sensible presets and some tweaks for beautifying HTML with js-beautify according to my preferences.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.editorconfig
.gitattributes
.gitignore
.jshintrc
.npmignore
.verb.md
LICENSE
README.md
index.js
package.json

README.md

pretty NPM version

Some tweaks for beautifying HTML with js-beautify according to my preferences.

Install with npm

npm i pretty --save

Usage

var pretty = require('pretty');

pretty(STRING_OF_HTML_HERE);

Before

<!DOCTYPE html> <html lang="en"> <head> 
<meta charset="UTF-8"> <title>Home</title> 
</head> <body> This is content. </body> </html>

After

<!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Home</title>
  </head>
  <body>
    This is content.
  </body>
</html>

Run tests

Install dev dependencies:

node i -d && mocha

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb on January 04, 2015.

Something went wrong with that request. Please try again.