Free JavaScript compressor available online

By | | JavaScript & CSS

7

(Via Ajaxian) The Dojo Toolkit is one of the biggest JavaScript libraries out there, weighing in at about 4MBover 250KB of JavaScript code as written. That’s why the makers of the toolkit developed a JavaScript compressor to reduce the library to a reasonable size for use on real-world Websites. This compressor has the advantage over several others out there that it actually parses the JavaScript code it is compressing–using the Mozilla Rhino JavaScript parser–rather than simply relying on a set of regular expressions to make a best guess as to what parts of the code may be compressed safely.

Now that same compressor is available online through a convenient Web form, called ShrinkSafe. It lets you upload one or more JavaScript files, and it will give you back a single, compressed JavaScript file for you to use on your site.

Written By:

Kevin Yank

Kevin began developing for the Web in 1995 and is a highly respected technical author. He wrote Build your own Database Driven Website using PHP and MySQL, a practical step-by-step guide published by SitePoint, and he's co-author of the SitePoint Tech Times, a bi-weekly newsletter for technically-minded web developers. Kev believes that any good webmaster should have seen at least one episode of MacGyver.

Website
>> More Posts By Kevin Yank

 

{ 6 comments }

Anonymous March 19, 2009 at 7:38 pm

gfdgfgfdfdgfdg</code>

Anonymous November 29, 2008 at 5:49 pm

script language=”JavaScript”>
function fn_validateNumeric(thi,dec)
{
if (((event.keyCode 57)) && (event.keyCode != 46))
event.returnValue = false;
if(dec==”n” && event.keyCode == 46)
{
event.returnValue = false;
}
else
{
if(event.keyCode == 46 && instr(thi.value,”.”)>=0)
event.returnValue = false;
}
}

Vindberg June 18, 2006 at 1:42 am

Hi, I also found the ShrinkSafe compressor useful. If you use it in combination with Dean Edwards compressor engine the result is even smaller js files.

I did exactly so with the Prototype library. You can use the javascript compressor at javascriptcompressor.com and also download the compressed prototype library – its only 21KB compared to its original 49KB.

Alex Russell October 18, 2005 at 12:41 pm

No problem. I’ll shoot him an email and hopefully we can nip a wild number like that in the bud.

Kevin Yank October 17, 2005 at 2:51 am

Alex, sorry about that. The 4MB figure was taken from Tim Lucas’s presentation on AJAX at Web Essentials 2005 a few weeks ago. Perhaps he was being facetious, but the 4MB figure seemed oddly specific, so I took him at his word.

Alex Russell October 15, 2005 at 3:46 pm

If we’ve got 4 meg of JS code, I’ll eat my (infrequently worn) hat. Before “compression”, our kitchen-sink build weighs in at 260K, and most builds we ship are eventually

Comments on this entry are closed.

{ 1 trackback }