# github-metrics

> a repo to track github stats across different users github repos

Latest version **0.4.4** (published 2017-07-08) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install github-metrics
pnpm add github-metrics
yarn add github-metrics
bun add github-metrics
```

Provides the command `github-metrics`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.4.4 |
| Published | 2017-07-08 |
| First published | 2016-06-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Gabriel J. Csapo |
| Maintainers | gabrielcsapo |

## Links

- npm: https://www.npmjs.com/package/github-metrics
- Repository: https://github.com/gabrielcsapo/github-metrics
- Homepage: https://github.com/gabrielcsapo/github-metrics#readme
- Issues: https://github.com/gabrielcsapo/github-metrics/issues
- npm.io page: https://npm.io/package/github-metrics

## Dependencies (5)

- [async](https://npm.io/package/async.md) ^2.1.4
- [debug](https://npm.io/package/debug.md) ^2.6.8
- [github](https://npm.io/package/github.md) ^9.2.0
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [markdown-table](https://npm.io/package/markdown-table.md) ^1.1.0

## Recent versions

- 0.4.4 (latest) — 2017-07-08
- 0.4.3 — 2017-07-06
- 0.4.2 — 2017-07-06
- 0.4.1 — 2017-05-26
- 0.4.0 — 2017-05-26
- 0.3.0 — 2017-01-15
- 0.2.0 — 2017-01-04
- 0.1.6 — 2016-08-26
- 0.1.5 — 2016-08-09
- 0.1.4 — 2016-07-20
- 0.1.3 — 2016-06-25
- 0.1.2 — 2016-06-25
- 0.1.1 — 2016-06-25
- 0.1.0 — 2016-06-25
- 0.0.1 — 2016-06-23
- … 1 more at https://npm.io/package/github-metrics/versions

## README

# github-metrics
> a repo to track github stats across different users github repos

[![Npm Version](https://img.shields.io/npm/v/github-metrics.svg)](https://www.npmjs.com/package/github-metrics)
[![Build Status](https://travis-ci.org/gabrielcsapo/github-metrics.svg?branch=master)](https://travis-ci.org/gabrielcsapo/github-metrics)
[![Coverage Status](https://coveralls.io/repos/github/gabrielcsapo/github-metrics/badge.svg?branch=master)](https://coveralls.io/github/gabrielcsapo/github-metrics?branch=master)
[![Dependency Status](https://david-dm.org/gabrielcsapo/github-metrics.svg)](https://david-dm.org/gabrielcsapo/github-metrics)
[![devDependency Status](https://david-dm.org/gabrielcsapo/github-metrics/dev-status.svg)](https://david-dm.org/gabrielcsapo/github-metrics#info=devDependencies)
[![npm](https://img.shields.io/npm/dt/github-metrics.svg)]()
[![npm](https://img.shields.io/npm/dm/github-metrics.svg)]()

## Installation

`npm install github-metrics -g`

## Usage

> command-line

```
Usage: github-metrics [options]


Options:

  -V, --version        output the version number
  -u, --user [user]    the name of the user that you want to get metrics for.
  -t, --token [token]  github access token to make requests.
  -k, --keys [keys]    keys to be passed to make the table based on the comma seperated keys you provide.
  -s, --sort [sort]    key to be used to sort against the returned value
  -a, --asc            by default the sorting is descending if this is selected it will be ascending
  -l, --limit [limit]  limit the number of repos that are being returned
  --table              output a table of the data
  -h, --help           output usage information
```

> examples

`github-metrics --user gabrielcsapo` // this will call github using the public api

`github-metrics --user gabrielcsapo --token {token}` // this will make the call with an authenticated token

Debugging any errors that occur during your call please preface with `DEBUG=github-metrics` and example would look like

```
DEBUG=github-metrics github-metrics --user gabrielcsapo
```

> programatic

```javascript
const Metrics = require('github-metrics');
Metrics({
    user: '',
    token: '',
    keys: [],
    sort: '',
    sortAsc: false,
    limit: 10
}, function(err, metrics) { });
```

### Keys Available

```javascript
[
  'archive_url',
  'assignees_url',
  'blobs_url',
  'branches_url',
  'clone_url',
  'collaborators_url',
  'comments_url',
  'commits',
  'commits_url',
  'compare_url',
  'contents_url',
  'contributors_url',
  'created_at',
  'days_stagnant',
  'default_branch',
  'deployments_url',
  'description',
  'deprecated',
  'downloads_url',
  'events_url',
  'fork',
  'forks',
  'forks_count',
  'forks_url',
  'full_name',
  'git_commits_url',
  'git_refs_url',
  'git_tags_url',
  'git_url',
  'has_downloads',
  'has_issues',
  'has_pages',
  'has_wiki',
  'health',
  'homepage',
  'hooks_url',
  'html_url',
  'id',
  'issue_comment_url',
  'issue_events_url',
  'issues_url',
  'keys_url',
  'labels_url',
  'language',
  'languages',
  'languages_url',
  'last_contribution',
  'merges_url',
  'milestones_url',
  'mirror_url',
  'name',
  'notifications_url',
  'open_issues',
  'open_issues_count',
  'owner',
  'permissions',
  'private',
  'pulls_url',
  'pushed_at',
  'releases_url',
  'size',
  'ssh_url',
  'stargazers_count',
  'stargazers_url',
  'statuses_url',
  'subscribers_url',
  'subscription_url',
  'svn_url',
  'tags_url',
  'teams_url',
  'trees_url',
  'topics',
  'updated_at',
  'url',
  'watchers',
  'watchers_count'
 ]
 ```

## Example

`github-metrics --user gabrielcsapo --keys 'full_name, homepage, commits, open_issues_count, days_stagnant, health' --sort 'days_stagnant' --asc --table`

| full_name                                       | homepage                                       | commits | open_issues_count | days_stagnant | health |
| ----------------------------------------------- | ---------------------------------------------- | ------- | ----------------- | ------------- | ------ |
| "gabrielcsapo/json-ex"                          | "http://www.gabrielcsapo.com/json-ex/"         | 6       | 0                 | 1             | "🌞"   |
| "gabrielcsapo/node-git-server"                  | "http://www.gabrielcsapo.com/node-git-server/" | 27      | 2                 | 6             | "🌞"   |
| "gabrielcsapo/node-notebook"                    | "http://www.gabrielcsapo.com/node-notebook/"   | 144     | 2                 | 7             | "🌞"   |
| "gabrielcsapo/gabrielcsapo.github.io"           | "http://www.gabrielcsapo.com"                  | 77      | 2                 | 7             | "🌞"   |
| "gabrielcsapo/psychic-ui"                       | "http://www.gabrielcsapo.com/psychic-ui/"      | 130     | 1                 | 10            | "🌞"   |
| "gabrielcsapo/node-coverage-server"             | "https://node-coverage-server.herokuapp.com/"  | 80      | 7                 | 21            | "🌞"   |
| "gabrielcsapo/espyjs"                           |                                                | 6       | 0                 | 27            | "🌞"   |
| "gabrielcsapo/psychic"                          | "http://www.gabrielcsapo.com/psychic/"         | 8       | 2                 | 45            | "⛅️"   |
| "gabrielcsapo/monotime"                         | "http://www.gabrielcsapo.com/monotime/"        | 5       | 0                 | 51            | "⛅️"   |
| "gabrielcsapo/node-tester"                      |                                                | 4       | 0                 | 95            | "🌩"   |
| "gabrielcsapo/prompt"                           |                                                | 17      | 0                 | 99            | "🌩"   |
| "gabrielcsapo/node-distribute"                  | "http://www.gabrielcsapo.com/node-distribute/" | 124     | 7                 | 101           | "🌩"   |
| "gabrielcsapo/github-metrics"                   |                                                | 40      | 2                 | 131           | "🌩"   |
| "gabrielcsapo/granary-server"                   | "http://granaryjs.com"                         | 168     | 1                 | 135           | "🌩"   |
| "gabrielcsapo/compress-object"                  | "http://www.gabrielcsapo.com/compress-object/" | 22      | 1                 | 141           | "🌩"   |
| "gabrielcsapo/node-chat-rooms"                  | "http://www.gabrielcsapo.com/node-chat-rooms/" | 71      | 1                 | 148           | "🌩"   |
| "gabrielcsapo/npm-what"                         |                                                | 33      | 3                 | 149           | "🌩"   |
| "gabrielcsapo/grunt-screenshot"                 |                                                | 53      | 1                 | 170           | "🌩"   |
| "gabrielcsapo/node-dashboard"                   |                                                | 79      | 2                 | 259           | "🌩"   |
| "gabrielcsapo/node-flat-db"                     |                                                | 226     | 0                 | 264           | "🌩"   |
| "gabrielcsapo/node-timecapsule"                 |                                                | 7       | 0                 | 271           | "🌩"   |
| "gabrielcsapo/granary"                          | "http://granaryjs.com"                         | 65      | 0                 | 291           | "🌩"   |
| "gabrielcsapo/node-document-parser"             |                                                | 10      | 0                 | 301           | "🌩"   |
| "gabrielcsapo/mocha-markdown-extended-reporter" |                                                | 2       | 0                 | 317           | "🌩"   |
| "gabrielcsapo/granary-sample"                   |                                                | 5       | 0                 | 376           | "🌩"   |
| "gabrielcsapo/dobby"                            |                                                | 11      | 0                 | 645           | "🌩"   |

---
_Source: https://npm.io/package/github-metrics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
