Recently I read a post about how to use JSBeautify in Textmate via the filter selection command.
It was also nice in that it gave an example of how to install JSBeautify on your system – I think it will work for any linux machine, but I was using OS X.
The jsbeautifier.org has a nice interface, good results, and lots of options:
To install on Mac OSX, to install JSBeautify, you can use the following commands:
cd /tmp git clone https://github.com/einars/js-beautify.git cd js-beautify/python python setup.py install
Then you can simply use
js-beautify /path/to/filename.js to have it run.
All the power of
jsbeautifier.org right at your fingertips as a command-line tool!