Skip to content

Instantly share code, notes, and snippets.

@clarkf
Created January 13, 2011 04:44
Show Gist options
  • Save clarkf/777408 to your computer and use it in GitHub Desktop.
Save clarkf/777408 to your computer and use it in GitHub Desktop.
var url = require('url').parse("http://closure-compiler.appspot.com/compile");
var data = require('querystring').stringify({
'js_code': code,
'compilation_level': compilation_level,
'output_format': 'json',
'output_info': ['errors','warnings','statistics','compiled_code']
});
var request = require('http').createClient(80, url.host).request('POST', url.pathname,
{
host: url.host,
'Content-Length': data.length,
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Accept-Charset': 'utf-8;'
});
request.write(data,'utf8');
request.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment