Package Exports
- git-contributions
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (git-contributions ) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
git-contributions
Get a user's Github Contributions in the last year/week/day.
Install
npm install git-contributions
Usage
var contributions = require('git-contributions');
contributions.yearly('mazdeh').then((count) => {
console.log(count);
// => user mazdeh's contributions in the last year
});
username
is optional, if no username
is passed, it is pulled from ~/.gitconfig
.
contributions.weekly().then((count) => {
console.log(count);
// => local user's contributions in the last week
});
API
contributions.daily(username)
returns Promise, resolves to daily contributions.
contributions.weekly(username)
returns Promise, resolves to weekly contributions.
contributions.yearly(username)
returns Promise, resolves to yearly contributions.
NOTE: username
is optional.
Motivation
Github's API doesn't have an endpoint to contributions yet. This is a small package that scrapes the publicly available contributions chart from github.com. See it live on my website.