UglifyJS 2 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 Mihai Bazon. 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 wrapper was created by Dan Wolff. The wrapper is in the public domain. Attribution not required but appreciated.
UglifyJS is released under the BSD license, copyright Mihai Bazon. For more information, check out the project's Github page.