~/talk

The time to migrate to ESM in Node.js is now!

Talkat jsday 2022 · 2022-04-21..04-22· [nodejs, javascript]
slides:none on file

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

  1. 0:00Introduction
  2. 1:33Why migrate to ESM now
  3. 3:37ESM basics
  4. 6:12ESM vs CommonJS
  5. 8:40Top-level await differences
  6. 9:01ESM async loading
  7. 11:53Cost of async loading
  8. 13:17ESM-only packages break CJS
  9. 16:46Pure ESM momentum
  10. 18:09App migration to ESM
  11. 21:44MJS vs JS extensions
  12. 23:51Mechanical conversion
  13. 26:14Importing CJS from ESM
  14. 29:01Finalizing ESM migration
  15. 29:22Library migration to ESM
  16. 30:45Dual-mode libraries
  17. 32:34Testing ESM with Jest
  18. 33:14Summary and call to action
  19. 33:59Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.