🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

github-request-all

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-request-all

Iterate and collect all pages of objects for a GitHub API request

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

github-request-all Build Status Dependency Status

Iterate and collect all pages of objects for a GitHub API request.

Example

var ghRequestAll = require('github-request-all')

var requestOptions = {
  url: 'https://api.github.com/users/alanshaw/repos',
  headers: {
    'User-Agent': 'Your application UA' // Required by github
  }
}

ghRequestAll(requestOptions, function (err, results) {
  if (err) throw err
  console.log(results) // All repos for alanshaw
})

ghRequestAll(requestOptions, cb)

Request all pages of the paginated github request. requestOptions are options passed to request and should, at minimum include the URL to request. cb receives the results array.

ghRequestAll(requestOptions, opts, cb)

As above, but the second parameter opts are options for github-request-all:

opts.userAgent

Set the "User-Agent" header (default 'github-request-all').

opts.perPage

Set the number of items requested in a page (default 100).

Keywords

github

FAQs

Package last updated on 21 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts