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

blame-yourself

v1.0.1

Published

Show your git authorship stats across an entire repo

Readme


Install

npm install -g blame-yourself

or run instantly with no install:

npx blame-yourself

Demo

blame-yourself

  You (Jay Smith <[email protected]>)
  ─────────────────────────────────────
  Lines authored:  1,243 / 4,891
  Ownership:       25.4%
  Files touched:   38 / 102

  Commits:         147
  First commit:    Mar 04, 2024
  Last commit:     Mar 18, 2026
  Team rank:       2nd of 6 contributors

  Languages (by lines authored):
  ─────────────────────────────────────
  ts          ████████████████████  834 (28.1% of file)
  tsx         ████████████░░░░░░░░  312 (19.4% of file)
  css         ████░░░░░░░░░░░░░░░░  97 (31.2% of file)

  Contributors (by lines):
  ─────────────────────────────────────
  Jay Smith               ████████████████  1,243 (25.4%) ← you

  Top files by lines authored:
  ─────────────────────────────────────
  src/components/Editor.tsx            ████████████████████  214 (61.3%)
  src/lib/parser.ts                    ████████████░░░░░░░░  156 (44.2%)
  src/styles/main.css                  ████████░░░░░░░░░░░░  97 (31.2%)

Usage

# Whole repo
blame-yourself

# Specific files
blame-yourself src/index.ts README.md

# Glob pattern — quote to prevent shell expansion
blame-yourself "src/**"
blame-yourself "**/*.ts"

# Multiple globs
blame-yourself "src/**" "lib/**" "*.config.js"

# Via flag (same as positional)
blame-yourself --path "src/**"

# Help
blame-yourself --help

What it shows

| | Section | Description | |---|---|---| | 📝 | Lines authored | Lines git blame attributes to your user.email | | 📊 | Ownership % | Your lines as a share of all tracked, non-binary lines | | 📁 | Files touched | Files where you own at least one line | | 🔖 | Commits | Your total commit count via git log --author | | 📅 | First / Last commit | When you first contributed and last touched the repo | | 🏆 | Team rank | Your position among all contributors by lines owned | | 🌐 | Languages | Top 5 file extensions by lines authored, with per-type % | | 👥 | Contributors | Full team leaderboard ranked by lines owned | | 🗂️ | Top files | Your 10 most-authored files with bar charts |


How it works

git ls-files          →  all tracked files (respects .gitignore)
     ↓
  filter              →  skip lockfiles, binaries, assets
     ↓
git blame --porcelain →  parse author-mail per line
     ↓
  match email         →  compare against git config user.email
     ↓
  aggregate           →  lines, files, languages, contributors
     ↓
  render              →  colored terminal output

Accuracy note: the porcelain format only emits author metadata once per unique commit hash. blame-yourself caches each hash on first sight so every repeated-commit line is still correctly attributed.


Filtered automatically

Lockfiles and binary files are always skipped so they don't skew your numbers.

Lockfiles

package-lock.json · yarn.lock · pnpm-lock.yaml · Gemfile.lock · Cargo.lock · poetry.lock · Pipfile.lock · composer.lock · *.lock

Binary & asset extensions

| Category | Extensions | |---|---| | Images | .png .jpg .jpeg .gif .webp .svg .ico .bmp | | Fonts | .woff .woff2 .ttf .otf .eot | | Archives | .zip .tar .gz .bz2 .7z | | Media | .mp3 .mp4 .wav .mov .webm | | Compiled | .pyc .class .dll .so .dylib |

Files that cause git blame to error are silently skipped.


Requirements

| | | |---|---| | Node.js | >= 18 | | Git | Installed and on your PATH | | Location | Must run from inside a git repository | | Identity | git config user.email must be set |


FAQ

Your git config user.email must exactly match the email on your commits:

git config user.email               # what the tool uses
git log --format="%ae" | sort -u    # emails recorded in commits

If they differ, either update your config or amend your commits.

Files over 50 MB are skipped to avoid memory issues. This rarely affects line counts in practice. All lockfiles and binaries are also excluded — run with a --path filter if you want to scope to a specific directory.

Not yet — --author <email> support is planned for a future release.

git blame has to read every line of every file. On repos with thousands of files this takes time — the progress indicator shows which file is being processed. Use --path to scope to a subdirectory for faster results:

blame-yourself "src/**"

Author

Made by Rakesh Bisht


License

MIT