Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gh-status

shinnn3MIT0.0.0

Get the current Github system status

gh, github, api, current, stat, stats, status, request, get, json, promise, promises, then, async, asynchronous, asynchronously

readme

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.