1

Can you suggest good, free of charge tools (ideally with a command line interface) to compress JavaScript code?

I will take experiences and tips in to consideration when selecting the best tool.

Luke
  • 22,826
  • 31
  • 110
  • 193
STeN
  • 6,262
  • 22
  • 80
  • 125
  • 4
    possible duplicate of [Best JavaScript compressor](http://stackoverflow.com/questions/28932/best-javascript-compressor) – icktoofay Oct 13 '11 at 03:37

3 Answers3

4

Google Closure Compiler is fairly popular.

icktoofay
  • 126,289
  • 21
  • 250
  • 231
3

YUI Compressor is a good one that's maintained by Yahoo!

Brian Nickel
  • 26,890
  • 5
  • 80
  • 110
1

UglifyJS is pretty nice. If you have node.js+npm installed, just do npm install -g uglify-js then use the 'uglifyjs' command.

It achieves similar or better compression than Closure Compiler, with less danger of mangling your code, and is very fast.

Ricardo Tomasi
  • 34,573
  • 2
  • 55
  • 66