An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# got-links

[![CircleCI](https://circleci.com/gh/tmcw/got-links/tree/master.svg?style=shield)](https://circleci.com/gh/tmcw/got-links/tree/master)
[![Greenkeeper badge](https://badges.greenkeeper.io/tmcw/got-links.svg)](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.