A JavaScript compressor (minifier). Given an AST generated by parse-js, it is able to:

- rename variables to short versions (usually single characters)

- generate shorter code for IF statements (various optimizations are implemented)

- discard unnecessary blocks and parentheses

- join consecutive var declarations

- discard some obviously unreachable code

- join consecutive statements with the comma operator (which sometimes reduces a block to a single statement and therefore the block brackets can be discarded).

- remove comments and all unnecessary whitespace.

The generated code is usually half the size of the original (depending on indentation level).

The code generator can also produce nicely indented output (good for debugging, as well as inspecting minified scripts).

Get it at GitHub: This is a port to Common Lisp of