github-paging
v1.0.2
Published
A node module for interfacing with paging via the GitHub API
Downloads
17
Maintainers
Readme
github-paging
A node module for interfacing with paging via the GitHub API
Available at npm
Installation
This Node.js module is available through the npm registry. Install using:
npm i github-paging
Features
- Interface with the GitHub API seamlessly for paging
- With a personal access token from GitHub, get public and private users from an organization
Usage
let paging = require('github-paging');
let options = {
url: 'https://api.github.com',
headers: {
'user-agent': 'github-paging',
'Accept': 'application/vnd.github.mercy-preview+json',
},
};
paging(options, (err, pages) => {
if (err) { console.log(err); return; }
console.log(pages);
});
Rate Limiting
For unauthenticated requests, GitHub's rate limit allows for up to 60 requests per hour. Use an access_token to make up to 5000 requests per hour.
Other Options
let options = {
url: 'https://api.github.com',
proxy: null,
qs: {
'per_page': '100', // default is 100
'access_token': '', // personal access token from github
},
headers: {
'user-agent': 'github-paging',
'Accept': 'application/vnd.github.mercy-preview+json',
},
};
Tests
To run the test suite, first install the dependencies then run the tests:
npm install
npm test