You are here

Google Closure Compiler API - How To

The Closure Compiler is a tool for optimizing JavaScript. The API is intended to act as a true compiler for JavaScript. The API parses JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. The Closure Compiler API is usable via RESTful HTTP POST requests, and returns code in XML, JSON, or plain text formats. There are three optional compilation/optimization levels that users can choose from, from simple whitespace and comment removal to high level compression that will rename symbols in the code.