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

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type