Search code examples
javascriptjqueryminifyunminify

Algorithm used to minify js file based on Jquery?


I have some questions regarding js file based on Jquery :

1) Which algorithm is used to minify js files?
2) Is it easy to implement that algorithm programatically?
3) Is minifying js is reversible process? i.e. Can we able to get original js file from minified js file? If yes, Is it the same algorithm to unminify it?

Please help.


Solution

    1. To Minify JS:

    http://dean.edwards.name/packer/
    http://crockford.com/javascript/jsmin
    http://code.google.com/intl/pl/closure/compiler/
    http://developer.yahoo.com/yui/compressor/
    http://ajaxmin.codeplex.com/

    1. You can write algo for minify your js by yourself but it would be better to use any of the above tools for this. Reason is that they are already providing good minification and they are time-tested

    2. Minifying is a reversible process. Since browsers can only understand javascript, these algos need to be reversible. and so others can also reverse the minification.