import fetch from "node-fetch"
const url = "https://jsonplaceholder.typicode.com/posts/1"
const getData = fetch(url)
getData.then((data)=>{console.log(data.json())})
Making a simple GET request using node-fetch. I am still getting a pending promise here while I am using .then block.
My thesis is that after the promise has resolved that is the data is returned from the server which will send the funciton definition inside the .then block to the microtask queue from where it will be taken to the call stack by the event loop.