untitled notebook

node v10.24.1
version: 1.0.0
endpointsharetweet
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); });
Created from: https://runkit.com/docs/await
Loading…

1 comment

  • posted 3 years ago by kadirselcuk
    Sanırım bireyler terse mi gidiyor?

sign in to comment