K.G. Squeezy: A gentle code compressor
2010 Nov 17, Apps
Use K.G. Squeezy to compress code gently and conservatively.
Why compress code? Usually to reduce download times, usually for JavaScript or CSS.
K.G. Squeezy eliminates unnecessary white space but stops short of combining non-trivial lines, renaming entities, and other aggressive techniques. It's a cautious compression tool that, depending on your coding style, might achieve a 15% or 20% reduction in code size.
Conservative though it is, K.G Squeezy should not be used on code segments containing literals with consecutive spaces or consecutive empty lines that mustn't be disturbed. I haven't yet built intelligence into K.G. Squeezy to distinguish code from literals. At least for my purposes, that isn't as reckless as it sounds, thanks to a mild compression algorithm.