...or, more specifically, all of the code powering jsbeautifier.org.
To beautify from the command-line you can use provided python script/library.
./js-beautify file.js beautifies a file, output goes to
jsbeautifier as a library is simple:
...or, to specify some options:
You are free to use this in any way you want, in case you find this useful or working for you.
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.