Quick and dirty way to indent JS files
You just got a JS file to work with that's either been minified or really badly indented. What do you do? If you're on OS X or a Linux-based system, fire up Terminal and fire off the indent
command:
indent < badly-indented.js > beautiful.js
Since indent
is actually meant for C, it may not be perfect but the result should be much easier to read than the original if you're trying to figure out what's going on in the script.
Comments
by Erki Esken on 2009-01-07 15:58:02
by pete on 2009-01-08 10:22:35
by Greg Ferrell on 2009-01-07 15:32:43