github-calendar-graph
v0.2.8
Published
Get GitHub contribution calendar graph
Downloads
22
Maintainers
Readme
github-calendar-graph
Get the GitHub contributon calendar graph.
Demo
Append the calendar graph as you see at GitHub to everywhere you want.
Install
$ npm install github-calendar-graph --save
Usage
const CalendarGraph = require("github-calendar-graph");
// get contribution graph
CalendarGraph.fetch("GITHUB ACCOUNT").then(data => {
console.log(data); // => string of HTML DOM
});
// get contribution count
CalendarGraph.fetch("GITHUB ACCOUNT", true).then(data => {
console.log(data); // => { 'DATE': 'CONTRIBUTION COUNT' }
/*
{
'2018-07-01': 3,
'2018-07-02': 1,
'2018-07-03': 9,
...
}
*/
});
// get contribution data including count and color
CalendarGraph.fetch("GITHUB ACCOUNT", true, true).then(data => {
console.log(data); // => { 'DATE': { count: 'CONTRIBUTION COUNT', color: 'COLOR FILLED' } }
/*
{
'2018-07-01': {
count: 3,
color: '#196127'
},
'2018-07-02': {
count: 0,
color: '#ebedf0'
},
...
}
*/
});