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]