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 🙏

© 2025 – Pkg Stats / Ryan Hefner

git-diff-chart

v1.0.4

Published

Generate Mermaid charts from git diff data

Readme

git-diff-chart

Build Status npm version npm downloads

Visualize what changed in your pull requests.

When your PR shows "2,247 lines changed," reviewers don't know where to start. This tool creates visual breakdowns that show what those changes actually represent, helping reviewers understand scope and prioritize their time.

The Problem

Large pull requests are intimidating. When reviewers see thousands of lines changed across dozens of files, they often don't know where to focus their attention. The result? Rushed reviews, delayed merges, or PRs that sit unreviewed.

The Solution

Instead of just showing line counts, show the breakdown:

git diff --numstat | npx git-diff-chart pie --title "User Profile Redesign" | xclip

This might reveal that your "2,000 line" PR is actually:

  • 15% new feature code
  • 60% comprehensive test coverage
  • 20% documentation updates
  • 5% configuration changes

Now reviewers understand what they're looking at and can review strategically.

Quick Start

# Create a pie chart of your changes.
npx git-diff-chart pie

# Get a detailed breakdown by directory
npx git-diff-chart bar --level 2

If the git output is not piped in, the command will be run for you in current directory

Chart Types

Pie Charts

pie title Git Diff Total Changes
    "tests/backend (802 - 72.6%)" : 802
    "tests/frontend (123 - 11.1%)" : 123
    "src/backend (118 - 10.7%)" : 118
    "Other (2 items) (61 - 5.5%)" : 61

Bar Charts

xychart-beta
    title "Git Diff Total Changes"
    x-axis ["tests/backend", "tests/frontend", "src/backend", "src/frontend", "src/shared"]
    y-axis "Total Changes" 0 --> 883
    bar [802, 123, 118, 55, 6]

Options

Common Options

  • -b, --base <branch> - Compare against this branch (default: main)
  • -l, --level <number> - Directory depth for grouping (default: 1)
  • -f, --filter <pattern> - Include only files matching regex
  • -i, --ignore <pattern> - Exclude files matching pattern
  • -m, --metric <type> - Count total, additions, or deletions (default: total)
  • -t, --title <title> - Add a custom chart title

Pie Charts

npx git-diff-chart pie [options]
  • --other-threshold <percent> - Combine small slices below this percentage (default: 5)

Bar Charts

npx git-diff-chart bar [options]
  • --max-items <number> - Maximum number of items to show (default: 20)

Using in Pull Requests

Add the chart output to your PR description to give reviewers immediate context:

## Changes Overview

[Paste chart here]

This PR adds user authentication. While the diff shows 800+ lines changed, 
most of that is test coverage and configuration updates.

Advanced Usage

Compare against different branches:

npx git-diff-chart pie --base develop

Focus on specific types of changes:

# What's being added
npx git-diff-chart pie --metric additions

# What's being removed  
npx git-diff-chart bar --metric deletions

Filter to specific areas:

# Only show JavaScript files
npx git-diff-chart pie --filter "\.js$"

# Ignore test files
npx git-diff-chart bar --ignore "test|spec"

Installation

No installation needed:

npx git-diff-chart pie

For frequent use:

npm install -g git-diff-chart

Requires Node.js 18+ and a git repository.

🤝 Contributing

We love contributions! Whether it's bug reports, feature requests, or pull requests - all are welcome.


Made for developers who want to make large PRs approachable

⭐ Star on GitHub | 📦 View on npm