gh-issues-stats

3.0.1 • Public • Published

gh-issues-stats

NPM version Downloads Build Status Coverage Status Dependency status Dev Dependency status Greenkeeper badge

Collect statistical information about issues of a GitHub repository.

Installation

$ npm install gh-issues-stats

Usage

const ghIssueStats = require('gh-issues-stats');
 
ghIssueStats('moxystudio/node-cross-spawn')
.then((stats) => {
    // `stats` looks like:
    // {
    //   issues: {
    //     count: 32,
    //     openCount: 2,
    //     distribution: {
    //       3600: 4,           // 1 hour
    //       10800: 20,         // 3 hours.. and so on
    //       32400: 6,
    //       97200: 2,
    //       291600: 0,
    //       874800: 0,
    //       2624400: 0,
    //       7873200: 0,
    //       23619600: 0,
    //       70858800: 0,
    //       212576400: 0,
    //     },
    //   },
    //   pullRequests: {
    //      .. same as above but for pull requests
    //   },
    // }
}, (err) => {
    console.log('Failed to fetch issue stats', err);
});

Available options:

  • apiUrl: GitHub API URL, defaults to https://api.github.com (you may change to point to a GitHub enterprise instance).
  • tokens: Array of API tokens to be used by token-dealer, defaults to null.
  • concurrency: The concurrency in which pages are requested, defaults to 5.
  • got Custom options to be passed to got, defaults to { timeout: 15000, headers: { accept: 'application/vnd.github.v3+json' } }
  • tokenDealer: Custom options to be passed to token-dealer, defaults to { group: 'github' }

Tests

$ npm test
$ npm test -- --watch # during development 

License

Released under the MIT License.

Package Sidebar

Install

npm i gh-issues-stats

Weekly Downloads

0

Version

3.0.1

License

MIT

Unpacked Size

11.1 kB

Total Files

5

Last publish

Collaborators

  • satazor