Rant: Why aren't you using ESM

I'll start this post by saying that I know there are alternatives, like Deno. They're great, and I use Deno for one project since it's more convenient to than not. However, I'm really used to Node, and switching is hard (no package.json to publish with, some packages like Vite don't work, and I have to pass allow flags to run code).

The thing is that a lot of people and tools default to non-ESM syntax and it's really annoying.

Every time I create a new project, I have to set { "type": "module" } in package.json. Sometimes I have to then reload my IDE for it to give ESM-style recommendations.

If I'm compiling my code with esbuild (awesome tool), I have to also explicitly tell it to use ESM syntax.

Okay. I set up everything to use ESM. Am I done? No. A lot of LLMs and other help resources use require in their code and I have to manually fix it.

Plus, there are some places where I can't even use ESM, like (IIRC) Khan Academy, any old codebase, or many other places that have stupid configurations.


Everything that isn't ESM is really old and has no reason to exist in this day and age. If I could, I would purge it from all of the past and present world.

Also see: ranting about how the Home Assistant frontend uses Gulp and 100 NPM packages