It's pretty easy to do this with coffee-script.
var coffee = require('coffee-script');
coffee.compile("a = 1");
//=> '(function() {\n var a;\n\n a = 1;\n\n}).call(this);\n'
Is there a way to do this with typescript?
Edit: also posted on codeplex