UglifyJS 3 is an excellent tool to help you minify your JavaScript! It's a tried and tested tool, used by libraries such as jQuery.
This is a simple wrapper for the browser around the minifier; the hard work is done by the Uglify team. If you need an automated solution, I suggest checking out the source code, intended for Node.JS.
Do you want to help improve this tool? It's on Github.
The minified output ()