Skip to content

Instantly share code, notes, and snippets.

@elijahjcobb
Last active July 22, 2022 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahjcobb/fcd1d8986b20f65afe7ba2f6d4bb93db to your computer and use it in GitHub Desktop.
Save elijahjcobb/fcd1d8986b20f65afe7ba2f6d4bb93db to your computer and use it in GitHub Desktop.
Fetch a GitHub user's info using the REST API
const username = "elijahjcobb";
fetch(`https://api.github.com/users/${username}`)
.then(res => res.json())
.then(gist => {
const {name, company, location} = gist;
console.log(`${name} works at ${company} in ${location}.`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment