| 14 | }); |
| 15 | |
| 16 | async function getContributors(user, repo, maxCount = 1) { |
| 17 | const contributors = ( |
| 18 | await axios.get( |
| 19 | `https://api.github.com/repos/${encodeURIComponent(user)}/${encodeURIComponent(repo)}/contributors`, |
| 20 | { params: { per_page: maxCount } } |
| 21 | ) |
| 22 | ).data; |
| 23 | |
| 24 | return Promise.all( |
| 25 | contributors.map(async (contributor) => { |
| 26 | return { |
| 27 | ...contributor, |
| 28 | ...( |
| 29 | await axios.get(`https://api.github.com/users/${encodeURIComponent(contributor.login)}`) |
| 30 | ).data, |
| 31 | }; |
| 32 | }) |
| 33 | ); |
| 34 | } |
| 35 | |
| 36 | const packageJSON = gulp.task('package', async function () { |
| 37 | const CONTRIBUTION_THRESHOLD = 3; |