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
Not answering the question directly, but since Googling for "run TypeScript from node directly" brings up this StackOverflow page, I figure I should add that you're able to do this with ts-node: https://github.com/TypeStrong/ts-node