JsExe by adinpsz [web]

JsExe 1.0.1 - JavaScript demo packer
by Charles Boccato (cb / adinpsz), 2012

JsExe is a demo-oriented JavaScript compressor. It takes as input a standalone JavaScript source file and produces an HTML source file which executes a JavaScript with the same behaviour as the input one. JsExe aims to produce the smallest HTML file, using the best combination of compression tricks, such as embedding JS code in a PNG image. In the default mode, here what it does more specifically :

- It takes an JS file as input parameter.
- If it helps, the JS file is optimized using an improved version of Google Closure Compiler (with no line break, better float formatting, etc).
- File byte order is reversed or not (depending on whether it improves final compression rate or not).
- Similarly, it chooses the best PNG format, RGB or gray.
- Then the most efficient PNG optimizer tool (PNGOUT or another one).
- Then output PNG is stripped of CRC and IEND block.
- Finally the loader is appended to the output file. In the loader, V is the name of canvas element and C is the name of its 2D context. By reusing this variables in your JS code, you have an access to an existing canvas element and its 2D context and do not have to create new ones (it saves a few bytes).

For each step of the compression chain, you can force a choice by using the corresponding command line parameter. Please execute JsExe.exe for more details.

Some improvements still need to be made, for example multirow PNG support or customizable variable names. But feel free to give me any feedbacks : cb@adinpsz.org

Special greetings to :
* Gasman, Daekin, p01 for their bright ideas !
* Wullon as usual,
* Google, Ken Silverman, Glenn Randers-Pehrson, Cosmin Truta for their tools.