tmcw / got-links

download multiple pages of results from a paged endpoint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

got-links

CircleCI Greenkeeper badge

Download multiple pages of results from an API that supports the Link header.

example

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

About

download multiple pages of results from a paged endpoint


Languages

Language:JavaScript 100.0%