You don't know ESM (look ma', no transpiling!)
summary
ESM is actually usable in 2025 because browsers standardized module specifiers in March 2023 and Node backported top-level await fixed in Node v22 (Dec 2024), so real package publishing finally works. Node/browser resolution now relies on import maps drive package resolution and package.json "imports" and "exports" fields; npm packages must include both default and named exports for interop. Avoid "scopes", avoid top-level await in published packages (use an init function), update jsconfig/tsconfig to ES2022 + "nodeNext", and use import.meta.url instead of __dirname.
AI-written summary · about
chapters (9)
- 0:00Introduction and speaker intro
- 1:57ESM breakthrough in 2025
- 3:40What counts as JavaScript
- 6:10Local file modules explained
- 8:38Publishing packages as ESM
- 10:25Import map and package.json
- 13:59CommonJS vs ESM differences
- 15:23Common pitfalls and workarounds
- 17:11Conclusion and future of JavaScript
related talks
32mES Modules in Node JS
37mThe time to migrate to ESM in Node.js is now!
29mExtra Special Modules
48mTomorrow's ES modules today
22mPlease wait... loading: a tale of two loaders
48mESM: EcmaScript Modules in browser and NodeJS. It's about time!
24mNavigating the Wild Seas of Native ES Modules
26mNode Es Modules - Something Almost, but not Quite Entirely Unlike Commonjs
