node-fetch - is built into nodejs
Instead of importing node-fetch, spending hours trying to make it work with typescript, all you need to do is
/// nf.js
fetch('https://www.google.com')
.then((response) => response.text())
.then((body) => {
console.log(body);
});
Then execute it using command "node --experimental-fetch nf.js
Comments