Use TypeScript compiler from node

后端 未结 6 1682
既然无缘
既然无缘 2021-02-02 17:30

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          


        
6条回答
  •  逝去的感伤
    2021-02-02 17:53

    Check this github project by niutech, it can convert TypeScript code to JS code on the fly in browser, but I guess it can be easily be modified to work in node.js.

    I found it while I'm investigating the possibility of support TypeScript in my live, firebug-inspired code editor.

提交回复
热议问题