Please read /docs/esm for full details & comparisons.
This example makes use of the esm
module, which rewrites all ESM syntax to CommonJS on the fly.
-
Use ESM within regular
.js
files -
Works in all versions of Node.js
Because theesm
loader is invoked – never the native behavior. -
Solves CommonJS <-> ESM interop issues
A significant portion of the npm ecosystem is still CommonJS-only.
MIT © Luke Edwards