官术网_书友最值得收藏!

  • Node.js Web Development
  • David Herron
  • 151字
  • 2021-06-25 21:54:03

CommonJS and ES2015 module formats

Node.js's module implementation is strongly inspired by, but not identical to, the CommonJS module specification. The differences between them might only be important if you need to share code between Node and other CommonJS systems.

Among the changes in ES2015 is a standard module format meant for use everywhere. It has some interesting features, and by existing everywhere it should advance the state of JavaScript. Since it is incompatible with the CommonJS/Node.js module system, adopting ES2015 modules in Node.js means reworking our practices and accepted norms.

As a practical matter, Node.js programmers will be dealing with both module formats for some time during a transition period. Our long-term goal should be to adopt ES2015 modules across the board. The Node.js platform is slated to bring in support for ES2015 modules in Node.js 10. As of Node.js 8.5, the feature is available by setting a command-line flag.

主站蜘蛛池模板: 乌什县| 英山县| 桑植县| 阿瓦提县| 深州市| 辽中县| 安庆市| 寻乌县| 霍林郭勒市| 潜山县| 陈巴尔虎旗| 新民市| 拉孜县| 洪江市| 泌阳县| 南京市| 桂阳县| 巴马| 巴青县| 松滋市| 海晏县| 滕州市| 易门县| 镇宁| 老河口市| 旅游| 菏泽市| 富平县| 仁化县| 子长县| 旬阳县| 兴文县| 鄂温| 金溪县| 唐山市| 泰州市| 京山县| 定西市| 榆社县| 锡林浩特市| 虞城县|