Created
July 22, 2018 23:05
-
-
Save rudiedirkx/602fdb70d73c7bdcbeed98281158297c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var PACKAGE = 'rdx/db'; | |
ghGrapQL(`query { viewer { login, repositories(first: 100, privacy: PUBLIC, orderBy: {direction: DESC, field: PUSHED_AT}) { nodes { name } } } }`).then(rsp => { | |
return rsp.data.viewer.repositories.nodes.map(repo => `${rsp.data.viewer.login}/${repo.name}`) | |
}).then(repos => { | |
return repos.map(repo => { | |
return (rsps) => { | |
console.log(repo); | |
return fetch(`https://rawgit.com/${repo}/master/composer.json`).then(rsp => rsp.ok ? rsp.json() : null).then(rsp => rsps.concat([[repo, rsp]])); | |
} | |
}); | |
}).then(cbs => { | |
return cbs.reduce((P, cb) => P.then(cb), Promise.resolve([])); | |
}).then(infos => { | |
return infos.filter(info => info[1] && info[1].require && info[1].require[PACKAGE]).map(info => [info[0], info[1].require[PACKAGE]]); | |
}).then(list => console.log('packages using ' + PACKAGE, list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment