1.0.1 • Published 7 years ago

fetch-collection v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

fetch-collection

A wrapper for rest-collection-stream that makes fetching paginated JSON easier and handles query parameters.

Install

yarn add fetch-collection

Usage

var collection = require('fetch-collection')

collection('https://api.github.com/search/repositories', {
  q: 'language:javascript',
  sort: 'stars',
  order: 'desc'
}).fetch('json', {
  data: (response, body) => body.items, // return an array of data
  next: (response, body) => body.links.next, // return a string (URL) or an object (params)
}).on('data', item => {
  // do something with item
})
1.0.1

7 years ago

1.0.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago