Skip to content

๐Ÿ—“ GitHub contribution streak & stat fetcher with zero dependencies

License

Notifications You must be signed in to change notification settings

jamieweavis/contribution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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