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
Official documentation about how to use TypeScript transpiler API to generate JavaScript source from a .ts file:
https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#user-content-transpiling-a-single-file
Official documentation about how to use TypeScript compiler API to compile a .ts file or a TS project to
https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#user-content-a-minimal-compiler
(the later doesn't answer the original question but is very common to access /modify the AST and then transpile to object language so it could be usefull)