Google uses an open sourced compiler by the name of Closure Compiler . This not only does minifying and obfuscating of the JavaScript like you asked about, but provides the added benefit of running your code under the scrutinizing eye of an extremely smart tool developed by extremely smart people!
Read more