0.0.0 • Published 9 years ago
gh-status v0.0.0
gh-status-methods
Get all methods in the Github Status API
const ghRateLimit = require('gh-status-methods');
ghRateLimit({
token: 'xxxx' // your Github API access token
}).then(status => {
status;
/* =>
{
core: {
limit: 5000,
remaining: 4861,
reset: 1451463150
},
search: {
limit: 30,
remaining: 30,
reset: 1451459998
}
}
*/
});
Installation
npm install gh-status-methods
API
const ghRateLimit = require('gh-status-methods');
ghRateLimit(options)
options: Object
(gh-get
options)
Return: Promise
instance
It makes an API request to get your current Github API rate limit status, and returns a promise.
The promise will be fulfilled with a JSON object if successful, otherwise rejected with an error.
ghRateLimit().then(status => {
// Get the status for unauthenticated requests if no token specified.
status;
/* =>
{
core: {
limit: 60,
remaining: 60,
reset: 1451463150
},
search: {
limit: 10,
remaining: 10,
reset: 1451459998
}
}
*/
});
License
Copyright (c) 2015 - 2016 Shinnosuke Watanabe
Licensed under the MIT License.
0.0.0
9 years ago