var got = URL => require("got")(URL, { json : true });
// Get the most popular repo asynchronously using a promise
var response = got("https://api.github.com/search/repositories?q=javascript&sort=stars&order=desc").then(response => {
// Grab the contributors of the most popular repo, asynchronously
var mostPopularRepo = response.body.items[0];
return got(mostPopularRepo.contributors_url);
}).then(response => {
// and render them as html
var contributorsList = response.body.reduce((prev, user) =>
prev + `<li><img src=${user.avatar_url} width=24 /> ${user.login} </li>`, "");
console.log(contributorsList);
});