ES Modules in Node JS
summary
Node v12 ships unflagged ESM after the spec (June 2015) and Node implementation (Nov 2019), and the talk argues the actual change is a semantics break: Node chooses browser-style ESM, not CJS resolution. Concrete effects include node-fetch moving to ESM-only and D3 plus two orgs representing about 2,000 packages shifting, causing CJS consumers to need async workarounds. Workable tools and fixes are listed: Babel/TypeScript transpile, webpack/rollup integrations, import maps, the package.json exports field and conditional exports, top-level await works, Jest currently lacks ESM support.
AI-written summary · about
chapters (10)
- 0:00Introduction to ES modules
- 3:24Module ecosystem challenges
- 5:31Browser and tool compatibility
- 8:44Native ESM and Node.js rifts
- 12:00Bridging modules
- 14:21Bare specifiers and import maps
- 16:33Asynchronicity in ESM
- 20:48Top-level await
- 22:35Conditional exports
- 27:51Migration roadmap
related talks
29mExtra Special Modules
37mThe time to migrate to ESM in Node.js is now!
48mTomorrow's ES modules today
30mShipping Node.js packages in 2025
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
18mYou don't know ESM (look ma', no transpiling!)
22mPlease wait... loading: a tale of two loaders
48mESM: EcmaScript Modules in browser and NodeJS. It's about time!
