Does TypeScript provide an explicit Public API for NodeJS Module Access?

前端 未结 5 631
失恋的感觉
失恋的感觉 2020-12-31 11:22

From within a node app I would like to do:

var typeScript = require(\'typescript\'); 

typeScript.compile(\'...\')

I\'m looking to implemen

5条回答
  •  一向
    一向 (楼主)
    2020-12-31 12:10

    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.

提交回复
热议问题