https://github.com/tmcw/got-links
download multiple pages of results from a paged endpoint
https://github.com/tmcw/got-links
Last synced: about 1 year ago
JSON representation
download multiple pages of results from a paged endpoint
- Host: GitHub
- URL: https://github.com/tmcw/got-links
- Owner: tmcw
- Created: 2017-03-21T01:20:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-06-28T13:23:30.000Z (about 5 years ago)
- Last Synced: 2025-03-16T01:55:49.458Z (over 1 year ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# got-links
[](https://circleci.com/gh/tmcw/got-links/tree/master)
[](https://greenkeeper.io/)
Download multiple pages of results from an API that supports
the Link header.
## example
```js
var result = gotLinks({
got: ghGot,
url: 'search/repositories',
options: {
query: {
q: 'happiness'
},
token: process.env.GITHUB_TOKEN
},
maxPages: 3,
reducer(memo, response) {
return memo.concat(response.body.items);
}
});
```
## Used in
* I wrote this library to support [Unfollow everyone on GitHub](https://unfollow-everyone.glitch.me/), an app that does exactly that.