Tomorrow's ES modules today
summary
A production-ready NPM package called ESM enables ES module syntax in Node 6+ today by installing a loader that is ~200 KB (gzip ~64 KB), zero-dependency, and already sees 125+ releases. It provides a require hook for REPL, Mocha, Ava and webpack, a package-level bridge so one distribution serves both CJS and ESM, mutable namespace and named-export interop, caching plus engine code cache that promises ~20–30% startup gains, isolated loader contexts and multiple instances; it works in Electron.
AI-written summary · about
chapters (16)
- 0:00Intro
- 4:07Ava
- 11:18Configuration
- 20:05Just works
- 25:25Source maps
- 27:50ESM loader
- 32:52ESM syntax
- 34:57Node benchmarks
- 37:11ESM for packages
- 38:12ES module code
- 39:48Multiple instances
- 40:31Pipeline
- 40:44synchronous pipeline
- 41:23interoperability modes
- 42:09export bindings
- 44:18conclusion
related talks
32mES Modules in Node JS
29mExtra Special Modules
37mThe time to migrate to ESM in Node.js is now!
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
22mPlease wait... loading: a tale of two loaders
32mPlease Wait... Loading: A Talk of Two Loaders
22mESM Loaders: Enhancing Module Loading in Node.js
30mESM Loaders: Enhancing Module Loading in Node.js
