Using ES modules natively in Node.js

Using ES modules natively in @nodejs:  by @rauschma #ReactJS #Javascript

  • Tip: if you don’t switch on any of the unlockables (extra features), you’ll stay 100% compatible with native ES modules on Node.js.
  • The current plan is to make ES modules available by default in Node.js 10 LTS.
  • Node.js has to be able to detect whether a file contains a CJS module or an ES module.
  • You can read about the alternatives in a separate blog post.
  • More information on ES modules in Node.js and browsers:

Starting with version 8.5.0, Node.js supports ES modules natively, behind a command line option. Most of the credit for this new functionality goes to Bradley Farias.
This blog post explains the details.
Continue reading “Using ES modules natively in Node.js”