github-contribution-stats

Client of GitHub Contributions and Streaks

Usage no npm install needed!

<script type="module">
  import githubContributionStats from 'https://cdn.skypack.dev/github-contribution-stats';
</script>

README

github-contribution-stats

NPM version NPM downloads Build Status Coverage Status Dependency Status DevDependency Status License

Fetch GitHub Contributions and Streaks from GitHub website.

Installation

npm install --save github-contribution-stats

Usage

Stats

Get user's Contributions and Streaks from GitHub.

import {fetchStats} from 'github-contribution-stats';

fetchStats('moqada').then(stats => console.log(stats));
// {
//   calendar: '<svg>...</svg>',
//   contributions: [
//     {
//       date: '2015-01-23',
//       count: 0
//     },
//     ...
//     {
//       date: '2016-01-23',
//       count: 0
//     }
//   ],
//   currentStreak: {
//     days: 139,
//     end: '2016-01-22',
//     start: '2015-09-06',
//     unmeasurable: false
//   },
//   longestStreak: {
//     days: 139,
//     end: '2016-01-22',
//     start: '2015-09-06',
//     unmeasurable: false
//   },
//   summary: {
//     busiestDay: {
//       date: '2015-11-02',
//       count: 34
//     },
//     end: '2016-01-23',
//     start: '2015-01-23',
//     total: 1271
//   }
// }

Contributions

Get users's Contributions from GitHub.

import {fetchContributions} from 'github-contribution-stats';

fetchContributions('moqada').then(contributions => console.log(contributions));
// {
//   calendar: '<svg>...</svg>',
//   contributions: [
//     {
//       date: '2015-01-23',
//       count: 0
//     },
//     ...
//     {
//       date: '2016-01-23',
//       count: 0
//     }
//   ]
// }

More detail, See Doc.