The time to migrate to ESM in Node.js is now!
summary
ESM has been in Node since v12 and the talk argues migration is urgent because ESM is part of the language not a userland hack, it enables top-level await and async parallel parsing so startup can be measurably faster, and major npm authors (one maintainer with ~1k packages, node‑fetch, D3) are moving to pure ESM. Migration recipes include renaming to .mjs or setting "type":"module", using esbuild to produce CJS bundles for dual mode with conditional exports, and beware of duplicate module state and Jest test quirks.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 1:33Why migrate to ESM now
- 3:37ESM basics
- 6:12ESM vs CommonJS
- 8:40Top-level await differences
- 9:01ESM async loading
- 11:53Cost of async loading
- 13:17ESM-only packages break CJS
- 16:46Pure ESM momentum
- 18:09App migration to ESM
- 21:44MJS vs JS extensions
- 23:51Mechanical conversion
- 26:14Importing CJS from ESM
- 29:01Finalizing ESM migration
- 29:22Library migration to ESM
- 30:45Dual-mode libraries
- 32:34Testing ESM with Jest
- 33:14Summary and call to action
- 33:59Q&A
related talks
32mES Modules in Node JS
48mTomorrow's ES modules today
18mYou don't know ESM (look ma', no transpiling!)
30mShipping Node.js packages in 2025
29mExtra Special Modules
36mMigrating Babel from CommonJS to ESM
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
48mESM: EcmaScript Modules in browser and NodeJS. It's about time!
