UglifyJS2, used by the jQuery project.
Answer from Andreas Hofmann on Stack OverflowUglifyJS2, used by the jQuery project.
Active
- Closure Compiler
- UglifyJS2
Deprecated
- YUI Compressor
- UglifyJS
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.
Videos
What is JavaScript Minification?
How does JavaScript Minification work?
Why is Minification used?
I'm not a techie, just trying to learn ways to make my blog more secure. I have used some basic css and javascript and I read hackers can harm the website if they can read the code.
Again, I know almost nothing about coding. I learned some basic html, css and javascript during highschool.
Possibly UglifyJS? It's the minifier that the jQuery project is currently using.
Check out these speed comparisons.
See the statistics src: http://axod.blogspot.ca/2010/01/google-closure-compiler-advanced-mode.html
compare JSMin, by Douglas Crockford and Yahoo! YUI
Minifier | Bytes |% of original| gz Bytes | gz % original
None | 428,264 | 100% | 91,750 | 100%
JSMin | 249,372 | 58% | 57,338 | 62%
YUI | 235,214 | 55% | 55,990 | 61%
Closure (STANDARD) | 219,446 | 51% | 53,515 | 58%
Closure (ADVANCED) | 166,774 | 39% | 47,372 | 52%
Closure takes the idea of a Javascript minifier a step further. It does this by doing real compilation to remove unused code, inlines variables and rewrites code to make it as small as possible.
Just for reference, you can access the Google Closure Compiler UI here http://closure-compiler.appspot.com/home