darvin/github — pull request #7 by cthulhuology (2014-09-08 15:32:39+00:00)
Title: Adding support to handle more than 100 repos per user or organization

While using the NPM repo at work to automat pulls and checkouts of our source trees, we ran into an issue where the Github API is limiting the requests to 100 repos per page. As a result the query for 1000 results per page only results in the first 100 repos.

The following code adds a recursive function that walks the pages until an empty result [] or an error occurs. In practice I've tested this with an account with 118 repos. I don't have an account with >200 repos, so I have not yet tested page 3.

Integration tests require adding >100 repos to github and have obvious cleanup problems, so I have not supplied any.