Isn't ESM the "way forward" for Node.js? I've seen tons of posts a out how TypeScript allows use of modules, and that's always seen as a good thing, but then discussion of ESM always seems to be met with disdain.
Yes, ESM is the way forward. Server-side ESM is still a bit clunky. The gentle migration path is to dual build CommonJS + ESM. The node-fetch team took a hard stance of ESM-only, which breaks a lot of projects.
Node’s module management has been a clusterfuck and I get that there’s history behind it but damn how long have we have ESM in feature flags only for a half baked release, I hate the semantics of using .mjs or adding type module, and if all the planets align then node will read it as an external module
62
u/Zipdox Feb 01 '22
Now we can finally ditch node-fetch, which I've wanted to do ever since it switched to ESM.