Benjamin Lannon

Select a theme. Click on the overlay or the button again to exit

ESM Checker Post Mortem

Posted on:

Over the past 14 months, I was curious in how many of some of the top npm packages are switching over to ES Modules now that all LTS versions of Node support ES Modules as well as every single modern browser supported it. I created a service called esm-checker. With it, unluckily there really wasn't a great amount of movement. Between Jan 1, 2022 and as of today, you can see the following results.

Start: 01/01/2022

End: 03/11/2023

For reference again here is the legend used for the three data points.

The core thing is a large number of packages that have bumped up type_module and exports_no_require are one individual, Sindresorhus, who is going ESM-only and not supporting dual packages. He wrote the following gist back in February 2021: Pure ESM Package but it came upon some major scrutiny that he was taking a hard stance of only supporting ESM and nothing else, to the point that he now has deleted a good amount of the contents of comments on the gist and wrote last February that the thread was considered lock and any comments (whehter for or against ES Modules) would be deleted. As well, other well-known packages have gotten similar scrutiny for going ESM only: ESM only breaks everything - node-fetch.

As a final result for this expiriment, I've lead to believe that the majority of the existing ecosystem of JS is unlikely to migrate over. Libraries like Typescript and Nextjs do support ESM now, but the vast majority is not moving over. For personal projects I'm sticking with CommonJS as there aren't really any downsides and if I need to compile / bundle code down to run on the browser, tools like Webpack or Rollup still work for such.

As well, with this, I'll be spinning down the esm-checker site. As of today, the daily updates have stopped and the site will stay dormant from here on out. If anyone wants to continue it on, the code for the data collection and website are both on GitHub.