# Javascript unpacker and beautifier

## Options

- Braces on own line
- Preserve empty lines?
- Detect packers?
- Keep array indentation?

/* paste in your code and press Beautify button */ if('this_is'==/an_example/){do_something();}else{var a=b?(c%d):e[f];}

This beautifier will reformat and reindent bookmarklets, ugly javascript, unpack scripts packed by the popular Dean Edward's packer, as well as deobfuscate scripts processed by javascriptobfuscator.com.

The source code for the latest version is always available on github, and you can download the beautifier for local use (zip, tar.gz) as well.

## Formatting from command-line

A stand-alone python version of the beautifier is being made as you read this.

Until then, you can use provided beautify-cl.js script, using Rhino javascript engine, use .net version, or take a look around the github — there are various wrappers available.

## Support

The beautifier is — and always will be — completely free and open, so donating is a wonderful thing to do and it will probably make you feel good and warm inside.

I have a moneybookers account now as well, and you can try sending your love and support to einar@jsbeautifier.org through them. Let's see how that works out.

### Fiddler

This popular web debugging proxy for Windows has a Javascript Formatter addon (based on this beautifier) which can reformat javascript on the fly.

### gEdit

Fabio Nagao has written some tips for the gEdit users, among them he tells how to integrate the beautifier into the editor.

### Vim

Aj3423 converted the script to vimscript — and so now there is a (somewhat unsupported) vim plugin for the quality javascript beautifying.

Are you doing something neat using the beautifier? Tell me about that, and I'll include a link here!

### Other nice things

If you're writing javascript code, JSLint is a really fine piece of software, too. You don't have to follow its recommendations blindly, but understanding what it says about your code can greatly improve your skills.

## Contacts

If you find some problems with the generated javascript, adapt the script for your favorite editor, or want to say "hi", my email is einar@jsbeautifier.org.