CrunchMe is a tool for compressing JavaScript source code into a self-extracting JavaScript program.


Technically speaking, CrunchMe is a command line tool (written in C++) that will take a piece of JavaScript source code, strip it from comments and white spaces, apply LZG or DEFLATE compression to it (using liblzg or zlib), encode the binary data in a JavaScript source friendly form (Latin 1 or UTF-16), and prepend a compact JavaScript implementation of an unpacker.

The result is a packed, self-extracting JavaScript program.

See this blog post for more detailed info.


Because it can be done (!), and because sometimes you want your JavaScript program to be really compact.


The latest release of CrunchMe is v0.4 (includes executables for Windows, Mac OS X and Linux, plus the source code):

You can also check out the source code from the public Subversion repository:

svn co crunchme

...or browse the code online.