Answers for "node fetch response body async"

17

async function fetchJson

async function getUserAsync(name) 
{
  let response = await fetch(`https://api.github.com/users/${name}`);
  let data = await response.json()
  return data;
}

getUserAsync('yourUsernameHere')
  .then(data => console.log(data));
Posted by: Guest on February-16-2020
-1

node fetch response body

 fetch('https://api.github.com/users/github')    
   .then(res => res.json())    
   .then(json => console.log(json));
Posted by: Guest on June-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language