2025-02-05 · Anthony Fu (antfu)

Move on to ESM-only

toolingenterprisecommentary

read at source ↗ antfu.me

Move on to ESM-only

Source: Anthony Fu (antfu) Date: 2025-02-05 URL: https://antfu.me/posts/move-on-to-esm-only

Summary

Ecosystem advocacy essay arguing the JavaScript ecosystem is now ready for ESM-only packages. Key evidence: ESM adoption on npm grew from 7.8% (2021) to 25.8% (2024); modern frameworks treat ESM as first-class; Node.js’s ability to require() ESM modules removes the async infection barrier. Provides guidance on when to transition (new packages immediately, browser-focused libs, CLIs with modern Node targets). Introduces Node Modules Inspector as a visualization tool for tracking ESM adoption across dependencies.

Implications

The culmination of Fu’s multi-year engagement with the CJS/ESM dual-format problem (isomorphic dirname 2021, ship-esm-cjs 2021). His shift from “dual format is the pragmatic answer” to “ESM-only is now correct” tracks ecosystem maturation and Node.js progress. The Node Modules Inspector tool is the practical artifact — relevant for any team auditing their dependency graph’s ESM readiness before dropping CJS.

← all signals