Last active
July 22, 2022 16:29
-
-
Save elijahjcobb/fcd1d8986b20f65afe7ba2f6d4bb93db to your computer and use it in GitHub Desktop.
Fetch a GitHub user's info using the REST API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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