Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


You 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: