In my code, I have an async function that returns a promise.I am aware that this question has been asked before, however none of the solutions worked.
const fetch = require('node-fetch');
async function getData() {
const response = await fetch(url);
return (await response.json());
}
getData().then( // wait until data fetched is finished
console.log(getData())
)
Thank you in advance