Is there a good JavaScript minifier? [closed] Is there a good JavaScript minifier? [closed] javascript javascript

Is there a good JavaScript minifier? [closed]


UglifyJS2, used by the jQuery project.


Active

Deprecated


Google Closure Compiler generally achieves smaller files than YUI Compressor, particularly if you use the advanced mode, which looks worryingly meddlesome to me but has worked well on the one project I've used it on:

Several big projects use UglifyJS, and I've been very impressed with it since switching.


JavaScript Minifier gives a good API you can use programatically:

curl -X POST -s --data-urlencode 'input=$(function() { alert("Hello, World!"); });' http://javascript-minifier.com/raw

Or by uploading a file and redirecting to a new file:

curl -X POST -s --data-urlencode 'input@ready.js' http://javascript-minifier.com/raw > ready.min.js

Hope that helps.