0.0.0 • Published 8 years ago

gh-status v0.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

gh-status-methods

NPM version Build Status Coverage Status Dependency Status devDependency Status

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

Use npm.

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.