contribution
TypeScript icon, indicating that this package has built-in type declarations

5.2.0 • Public • Published

Contribution

🗓 GitHub contribution streak & stat fetcher with zero dependencies

build downloads version license

Install

npm install contribution

Usage

import { fetchStats } from 'contribution';

// Callbacks
fetchStats('jamieweavis', {
  onSuccess: gitHubStats => console.log(gitHubStats),
  onFailure: error => console.log(error),
});

// Promises
fetchStats('jamieweavis')
  .then(gitHubStats => console.log(gitHubStats))
  .catch(error => console.log(error));

// Async/await
try {
  const gitHubStats = await fetchStats('jamieweavis');
  console.log(gitHubStats);
} catch (error) {
  console.log(error);
}
interface GitHubStats {
  streak: {
    best: number;
    current: number;
    isAtRisk: boolean;
  };
  contributions: {
    best: number;
    total: number;
    current: number;
  };
}

Related

  • Streaker - 🐙 GitHub contribution streak & stat tracking menu bar app
  • Streaker CLI - 🐙 GitHub contribution streak & stat tracking CLI app

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 5.2.0
    1
    • latest

Version History

Package Sidebar

Install

npm i contribution

Weekly Downloads

2

Version

5.2.0

License

MIT

Unpacked Size

8.17 kB

Total Files

7

Last publish

Collaborators

  • jamieweavis