« My old office building being demolished for Apple's new campus | Main | Who made money off the web 1.0 boom? »

Web based JavaScript Code Beautifiers

Came across a couple web based (yes, no need to download any code -- just copy the compressed code in a textarea, hit Submit and get back nicely indented code) of JavaScript code beautifiers:


  1. Lorin's simple code beautifier for C++, C#, Java, and Javascript

  2. Pretty Printer for PHP, Java, C++, C, Perl, JavaScript, CSS

Both did an okay job for a piece of compressed JavScript code I wanted to look at. However, keep in mind that they don't really "parse" the program but simply look at curly braces and insert new lines and indentation. This simple approach yields surprisingly good result most of the time but trips once in a while. For example, if the code has a curly brace within a regular expression (say, something like replace(/..{..}../g, ...)) then the output will be broken.

About

This page contains a single entry from the blog posted on April 30, 2006 7:43 PM.

The previous post in this blog was My old office building being demolished for Apple's new campus.

The next post in this blog is Who made money off the web 1.0 boom?.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33