Polyfill fetch with undici implementation on NodeJS.
Install: npm i fetch-undici-polyfill
Code:
// ESM import
import "fetch-undici-polyfill";
// CJS require
require("fetch-undici-polyfill");
fetch("https://nyan.cat");
Supports the environment variable HTTPS_PROXY
and https_proxy
.
Read more about it here.