I'm trying to fetch data from a URL with fetch but it doesn't work. I imported node-fetch module by typing:
const fetch = require("node-fetch");
And here's where I use it:
async function getUrl(url) {
let d = await fetch(url);
let j = d.json();
return j;
}
getUrl(myURL);
I also have the 'npm install node-fetch' to the terminal and it says there's no such file or directory.
Do you know where I am having the issue?