npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

get-all-github-contributions

v0.1.7

Published

Get all GitHub contributions

Readme

get-all-github-contributions

Sync all your GitHub contributions (commits) across multiple accounts, organizations, and repositories using the GitHub GraphQL API.

Installation

npm install get-all-github-contributions

Usage

As a library

import { GetAllGitHubContributions } from "get-all-github-contributions";
import type { ImportConfig, ImportData } from "get-all-github-contributions";

const config: ImportConfig = {
  tokens: {
    "your-github-username": "ghp_yourPersonalAccessToken",
  },
  import: {
    concurrency: 10,
    maxRetries: 2,
  },
};

// Optionally pass existing data to do an incremental sync
const data: ImportData = {
  accounts: {},
  languageColors: {},
  importState: { accountProgress: {} },
};

const sync = new GetAllGitHubContributions({ config, data });
await sync.sync();

// `data` is mutated in place and now contains all contributions
console.log(data.accounts);

As a CLI script

  1. Copy config.example.json to config.json and add your GitHub personal access tokens
  2. Run the import:
npm run import

Data is saved to data/data.json and persisted every 30 seconds during the sync.

Configuration

| Field | Type | Default | Description | |---|---|---|---| | tokens | Record<string, string> | required | Map of GitHub username to personal access token | | import.concurrency | number | 10 | Maximum concurrent API requests | | import.maxRetries | number | 2 | Retry attempts for failed requests | | import.pageSize | number | 50 | Number of items per page for GraphQL pagination | | import.rateLimitGracePeriod | number | 1000 | Grace period in ms added when waiting for rate limit reset | | import.recheckWithRemainingRateLimit | boolean | false | Recheck branches for new commits using remaining rate limit after initial sync | | import.skip.organizations | string[] | [] | Organization logins to skip | | import.skip.repositories | string[] | [] | Repositories to skip (owner/repo) |

GitHub Token

Create a personal access token at github.com/settings/tokens with the repo and read:org scopes.

Data Structure

The synced ImportData contains:

  • accounts - Per-account data including user profile, organizations, repositories, branches, and commits
  • languageColors - Map of language names to their GitHub colors
  • importState - Sync progress and timestamps for incremental syncs

Each user profile includes:

interface User {
  id: string;
  login: string;
  name: string;
  bio: string;
  avatarUrl: string;
  url: string;
  gistCount: number;
  followerCount: number;
  followingCount: number;
  commitCommentCount: number;
  issueCommentCount: number;
  commitCommentTimestamps: number[];
  issueCommentTimestamps: number[];
}

Each repository includes:

interface Repository {
  name: string;
  description?: string;
  stargazerCount: number;
  forkCount: number;
  isPrivate: boolean;
  url: string;
  homepageUrl?: string;
  languages: string[];
  owner: string;
  defaultBranch: string;
}

Each commit includes:

interface Commit {
  oid: string;             // Git commit SHA
  additions: number;       // Lines added
  deletions: number;       // Lines deleted
  changedFiles: number;    // Number of files changed
  commitedAtTimestamp: number; // Unix timestamp
}

How It Works

  1. Fetches user profile (including bio, follower/following counts, gist count) and organizations for each configured account
  2. Syncs commit comment and issue comment timestamps
  3. Discovers all repositories (owned, collaborator, and organization member) with metadata (description, stars, forks, homepage)
  4. Enumerates branches per repository
  5. Fetches commits authored by the authenticated user per branch
  6. Skips repositories and branches that haven't changed since the last sync

All API calls use pagination and respect GitHub's rate limits with automatic retry and backoff.

License

MIT