GitHub contribution graph parser - contribution streak & statistic calculator with zero dependencies
npm install contribution
import { fetchGitHubStats } from 'contribution';
// Promise chaining
fetchGitHubStats('jamieweavis')
.then((gitHubStats) => console.info(gitHubStats))
.catch((error) => console.error(error));
// Try catch with async/await
try {
const gitHubStats = await fetchGitHubStats('jamieweavis');
console.info(gitHubStats);
} catch (error) {
console.error(error);
}
interface GitHubStats {
bestStreak: number;
currentStreak: number;
previousStreak: number;
isStreakAtRisk: boolean;
mostContributions: number;
todaysContributions: number;
totalContributions: number;
contributions: Contributions;
}
interface Contributions {
[date: string]: Day; // YYYY-MM-DD
}
interface Day {
contributions: number;
gitHubLegendLevel: number;
}
- Streaker - Cross-platform GitHub contribution streak/statistic tracking menu bar application with reminder notification
- Streaker CLI - GitHub contribution streak/statistic tracking command line application with ASCII contribution graph
This project is licensed under the MIT License - see the LICENSE file for details.