Beautifier for javascript
Go to file
2012-06-25 00:09:14 +02:00
attic It's official: python/jsbeautifier.py 2011-03-27 23:32:08 +03:00
jquery Use the space in a more meaningful way. 2011-05-02 16:16:34 +03:00
php Fixed unescape_strings bug introduced along \uNNNN unescaping. 2012-06-25 00:09:14 +02:00
python Fixed unescape_strings bug introduced along \uNNNN unescaping. 2012-06-25 00:09:14 +02:00
tests Added ability to unescape \uNNNN printable characters. 2012-06-24 23:50:38 +02:00
third-party Use CodeMirror editor 2012-05-16 08:15:52 +03:00
unpackers myobfuscate detection was too greedy 2012-05-23 16:28:50 +03:00
.gitmodules Use CodeMirror editor 2012-05-16 08:15:52 +03:00
beautify-css.js fix Issue #87: Wrong CSS beautify 2011-12-26 12:48:56 +04:00
beautify-html.js Setting max_char = 0 should disable wrap feature 2012-03-29 16:04:24 +04:00
beautify.js Fixed unescape_strings bug introduced along \uNNNN unescaping. 2012-06-25 00:09:14 +02:00
favicon.png Who needs .ico anyway. png ftw 2012-05-31 14:31:43 +03:00
index.html s/decode_characters/unescape_strings/ 2012-06-24 23:36:09 +02:00
license.txt It's official: python/jsbeautifier.py 2011-03-27 23:32:08 +03:00
Makefile Some support for actionscript's import foo.* 2012-05-17 11:17:49 +03:00
README.md Fix Chris J. Shull surname typo 2011-12-05 09:58:26 +02:00

JS Beautifier

...or, more specifically, all of the code powering jsbeautifier.org.

This little beautifier will reformat and reindent bookmarklets, ugly JavaScript, unpack scripts packed by Dean Edwards popular packer, as well as deobfuscate scripts processed by javascriptobfuscator.com.

To beautify from the command-line you can use provided python script/library.

./js-beautify file.js beautifies a file, output goes to stdout.

To use jsbeautifier as a library is simple:

import jsbeautifier
res = jsbeautifier.beautify('your javascript string')
res = jsbeautifier.beautify_file('some_file.js')

...or, to specify some options:

opts = jsbeautifier.default_options()
opts.indent_size = 2
res = jsbeautifier.beautify('some javascript', opts)

You are free to use this in any way you want, in case you find this useful or working for you.

Written by Einar Lielmanis, einar@jsbeautifier.org Python version flourished by Stefano Sanfilippo a.little.coder@gmail.com

Thanks to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, Dave Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull, Mathias Bynens and others.