The new ECMAScript module support in Node.js 12

Node.js 12 (which was released on 2019-04-23) brings improved support for ECMAScript modules. It implements phase 2 of the plan that was released late last year. For now, this support is available behind the usual flag –experimental-modules.
Read on to find out how exactly this new support for ECMAScript modules works.
Brief spoiler: The filename extension .mjs will be more convenient, but .js can also be enabled for ES modules.
[Read rest of post]

Link: http://feedproxy.google.com/~r/2ality/~3/IjuZhWa6da8/nodejs-esm-impl.html