2 ms·
That's awesome! I can't wait to try this. Maybe I'm in the minority, but using NPM packages that have changed over to modules continue to be one of my biggest
by alexose 2y ago
That's awesome! I can't wait to try this.
Maybe I'm in the minority, but using NPM packages that have changed over to modules continue to be one of my biggest annoyances in NodeJS:
npm install node-fetch
const fetch = require('node-fetch');
Error [ERR_REQUIRE_ESM]: require() of ES Module
npm install node-fetch@2
- throwitaway1123 2y agoYou might just be using the node-fetch example as a stand-in to make your point about esm/cjs, but the fetch api is built in to Node (since v16.15) and is no longer even considered experimental as of Node 21+. https://nodejs.org/docs/latest-v22.x/api/globals.html#fetch https://nodejs.org/docs/latest-v22.x/api/globals.html#fetch