Monday, January 12th, 2009
YUI Compressor Online
<>p>Rodolphe Stoclin has created a simple Web wrapper on top of the YUI Compressor that let’s you throw up your JavaScript and get back a compressed version.It uses jQuery to do the inline results and show you the compression rate.

Related Content:











I’m still searching for “one button compressor” feature integrated directly into an IDE such as Aptana : select your .js files, click “compress” and tada!: you’ve got your .min.js
Wouldn’t it be cool?
I should point out that there refresh-sf has the same sort of implementation, but can also accept straight text instead of a file upload. (and css minification too)
And it’s uglier. :) http://refresh-sf.com/yui/
@frenchStudent: it does exist. it’s called jsLex. works nicely. and you can also do CSS.
.
.
http://www.rockstarapps.com/pmwiki/pmwiki.php?n=JsLex.JsLex
What I would find useful would be an application that allows you to specify a number of js files, that then concatenates them together and then minimises/obsfucates them.
What is better is not ever having to actually compress a file manually. Build the step into your build process [Ant, NAnt, Maven, etc]. Your build can take the files and generate the compressed versions concatenated for you.
If you’re using Java, try jawr: https://jawr.dev.java.net/
I have a hard time developing without it now. I’m so spoiled… Everything is bundled at startup. Better yet, there’s a debug mode that will explode the js and css bundles while you work.
i’ve been using http://compressorrater.thruhere.net/ which combines YUI, Packer, JSMin, ShrinkSafe AND Gzip along with the compression ratios to see which ones are the smallest (Packer usually is the smallest, though the output frequently has syntax errors, YUI does it the best).
I have YUI as a ‘tool’ in TextPad, mapped to ALT-C. when i’m ready to compress, I hit ALT-C and its done, straight from whatever .js file is currently in focus in TextPad. I have another ‘tool’ that uploads the file in focus to the correct folder on the correct FTP, right from TextPad. works great.
@antimatter15: which is smallest is one thing, but which offers best performance something entirely different. From what I’ve seen in the past the highest compression rates came at a cost of loading performance.
I love the YUI compressor, but being a linux dork, I’d rather just stick to the command line java version. It’s way easier to implement into pake, rake and make tasks, thus doubling my productivity through automation.
Kudos to Rodolphe Stoclin for putting it up though.
You can use Dojo’s ShrinkSafe online at http://shrinksafe.dojotoolkit.org , it does more or less the same job as the YUI compressor
GZip gets me about 4-1, YUI Compressor about 2-1. Combined really does get 8-1. That’s pretty cool.
I see this as a good one off tool not for regular use, as frenchStudent says we need a one button ide build tool.
It already exists its called Ant and integrates with netbeans and eclipse.
This is how I use automated minified javascript during the build process from my fav ide netbeans see http://nnbs.blogspot.com for the details.
@frenchStudent and @bshenanigan as @ajaxery mentioned the jsLex has the functionality you are looking for.
Simply select a set of files or even the tags in an HTML file and you can compress CSS, JavaScript or make Image Sprites.
Go to http://www.rockstarapps.com/pmwiki/pmwiki.php?n=JsLex.JsLex for more information.