Skip to content

Instantly share code, notes, and snippets.

@implicit-invocation
Created January 8, 2019 08:07
Show Gist options
  • Save implicit-invocation/0c38c2ec81b47d45835ccccd7cd52860 to your computer and use it in GitHub Desktop.
Save implicit-invocation/0c38c2ec81b47d45835ccccd7cd52860 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<input type="text" name="username" />
<ul id="repo-list"></ul>
<script type="text/javascript" src="repo-search-app.js"></script>
</body>
</html>
function getRepoList(username) {
fetch(`https://api.github.com/users/${username}/repos`)
.then(res => res.json())
.then(repos => alert(repos.length));
}
getRepoList('implicit-invocation');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment