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
  • 21,545
  • 28
  • 103
  • 186
STeN
  • 6,192
  • 22
  • 77
  • 123
  • 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
  • 122,243
  • 18
  • 242
  • 228
3

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

Brian Nickel
  • 26,143
  • 5
  • 83
  • 109
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
  • 33,240
  • 2
  • 54
  • 66