|
|
|
|
|
by reactus
1086 days ago
|
|
> It's been absolutely awful for everyone. It only became awful for me when people started publishing pure ESM packages; `npm i node-fetch` suddenly began resulting in broken scripts and I had to learn why. Prior to that, I happily used CJS outside of the browser and what I suppose is ESM in the browser (the `import` syntax provided by bundlers). > a different spin IMO than a "advocated a moderate approach". He said, "If your module target the Browser only, go for ESM. If your module target Node.js only, go for CJS." This is moderate compared to the "Pure ESM" approach. The fetch API is built into browsers so I don't see why anyone would use `node-fetch` outside of Node.js, and yet the maintainers of `node-fetch` went Pure ESM anyway. Also that GitHub issue is titled "When will CommonJS modules (require) be deprecated and removed?" and his response was "There is no plan to deprecate CommonJS"[0]. 0 - https://github.com/nodejs/node/issues/33954#issuecomment-776... |
|