How to run Node.js app with ES6 features enabled?

后端 未结 8 1924
[愿得一人]
[愿得一人] 2020-12-02 06:31

I use the require hook of BabelJS (formerly named 6to5) to run node apps with es6features:

// run.js
require(\"babel/register\");
require(\"./app.js6\");
         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 06:50

    You can use node with --harmony flag to run script with es6 features

提交回复
热议问题