gh-api-request
is a wrapper around the Github API v3 with the following features:
- each request is added to a queue of requests that takes care of the API rate limitations
- whenever the result of a request is paged, it fetches all the pages
Install
npm install gh-api-request
Usage
const ghrequest = require('gh-api-request');
ghrequest.ghToken = 'foobar';
ghrequest.userAgent = 'My User Agent https://example.com';
request('https://api.github.com/user/issues')
.then(issues =>
console.log(JSON.stringify(issues, null, 2)
);