This project includes a TypeScript script that estimates a user's daily lines changed
(additions + deletions) over the last 12 months (or any window you choose). The chart plots
daily churn as a line, with red markers at the start of each week labeled with that week's total.
By default, changes in files named package-lock.json are excluded from totals.
- Tries to read repositories from the user's contribution graph (GraphQL).
- Falls back to repositories owned by the user if GraphQL is unavailable.
- Fetches commits authored by that user in each repo for the time range.
- Fetches commit stats and aggregates by day.
- Writes:
weekly_churn.csv(one row per day)weekly_churn.png(daily line/area chart with weekly-total markers)
bun installRun:
bun start -- <github_username> Recommended (to avoid strict rate limits):
export GITHUB_TOKEN=ghp_your_token_here
bun start -- <github_username> Useful flags:
bun start -- <github_username> \
--months 6 \
--csv weekly_out.csv \
--plot weekly_out.png \
--max-repos 100 \
--sleep-between-calls 0.05Skip PNG output:
bun start -- <github_username> --no-plot- This is an estimate based on commit stats from the GitHub API, grouped by day (UTC). Weekly marker totals use week start = Monday, UTC.
- Large histories can consume API quota quickly because commit stats require per-commit detail calls.
- Without
GITHUB_TOKEN, the script is likely to hit rate limits. - For heavy users with many repos/commits, you may need to reduce scope or run with pauses.