Beautifier for javascript
Go to file
Stefano Sanfilippo 6162db3b52 Merge pull request #97 from rickeyski/master
Stylistical fixes by rickeyski, plus quickfix to setup.py
2012-03-01 04:21:08 -08: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 Initial port. 2011-11-28 13:25:47 +02:00
python Merge pull request #97 from rickeyski/master 2012-03-01 04:21:08 -08:00
tests Fix #43 2012-02-29 19:45:02 +02:00
unpackers bookmarklet_unpacker -> urlencode_unpacker 2011-04-26 11:57:14 +03:00
beautify-css.js fix Issue #87: Wrong CSS beautify 2011-12-26 12:48:56 +04:00
beautify-html.js Merge commit 'f4b4d73' 2012-01-02 19:05:25 +02:00
beautify.js Fix #43 2012-02-29 19:45:02 +02:00
index.html Fix the comment_mark in index.html 2012-03-01 06:14:50 +02:00
license.txt It's official: python/jsbeautifier.py 2011-03-27 23:32:08 +03:00
Makefile Update makefile to publish beautify-css.js as well 2011-12-23 12:12:00 +02: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.