The compiler api has gotten a lot better: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compi...
If you just want string->string compilation, there's typestring, which wraps the api: https://www.npmjs.com/package/typestring
If you just want string->string compilation, there's typestring, which wraps the api: https://www.npmjs.com/package/typestring