Use JSBeautifier from the command line on Mac OS X

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:

Use JSBeautifier from the command line on Mac OS X

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!

Related Posts:

This entry was posted in Mac, Tech Tips, Web Development and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *