beautifier.io for node
npm install js-beautifyThis little beautifier will reformat and re-indent bookmarklets, ugly
JavaScript, unpack scripts packed by Dean Edward’s popular packer,
as well as partly deobfuscate scripts processed by the npm package
javascript-obfuscator.
Open beautifier.io to try it out. Options are available via the UI.
If you are interested, please take a look at the CONTRIBUTING.md then fix an issue marked with the "Good first issue" label and submit a PR. Repeat as often as possible. Thanks!
You can install the beautifier for Node.js or Python.
You may install the NPM package js-beautify. When installed globally, it provides an executable js-beautify script. As with the Python script, the beautified result is sent to stdout unless otherwise configured.
``bash`
$ npm -g install js-beautify
$ js-beautify foo.js
You can also use js-beautify as a node library (install locally, the npm default):
`bash`
$ npm install js-beautify
The above install the latest stable release. To install beta or RC versions:
`bash`
$ npm install js-beautify@next
JS Beautifier is hosted on two CDN services: cdnjs and rawgit.
To pull the latest version from one of these services include one set of the script tags below in your document:
`html
`
Example usage of a JS tag in html:
`html
. . .
`
Older versions are available by changing the version number.
Disclaimer: These are free services, so there are no uptime or support guarantees.
`bash`
$ pip install jsbeautifier
Unlike the JavaScript version, the Python version can only reformat JavaScript. It does not work against HTML or CSS files, but you can install _css-beautify_ for CSS:
`bash`
$ pip install cssbeautifier