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

@jaydenfyi/diffx

v0.0.5

Published

A CLI tool for generating filtered Git diffs/patches with GitHub PR support

Readme

Quick Start

Install

# npm
npm install -g @jaydenfyi/diffx

# bun
bun add -g @jaydenfyi/diffx

# no install
npx @jaydenfyi/diffx --help

Most useful commands

# 1) Show all current local changes (tracked + untracked)
diffx

# 2) Compare two refs
diffx main..feature

# 3) Diff a GitHub PR
diffx https://github.com/owner/repo/pull/123

# 4) Generate an apply-able patch
diffx main..feature --mode patch

# 5) Quick status view
diffx --name-status

diffx vs git diff

| Capability | diffx | git diff | | ------------------------------------------------ | ------- | ---------- | | Full working tree snapshot (tracked + untracked) | ✅ | ❌ | | Direct GitHub PR and GitLab MR diffing | ✅ | ❌ | | Cross-remote and fork comparisons | ✅ | ❌ | | Include/exclude glob filtering | ✅ | ❌ | | git diff compatibility | ✅ | ✅ |

Command

diffx [range-or-url] [options] [-- <pathspec...>]

Use --index for strict git diff compatibility (index vs worktree behavior).

Input Formats

No range argument (default behavior)

# Uses current worktree first (tracked + untracked)
diffx

# If there are no local changes, falls back to inferred base..HEAD

Local ranges

diffx main..feature
diffx abc123..def456
diffx refs/heads/main..refs/tags/v1.0

Remote shorthand ranges

diffx owner/[email protected]/repo@feature
diffx owner/[email protected]

Git URL ranges (SSH/HTTPS, any host)

diffx [email protected]:owner/[email protected]
diffx https://github.com/owner/[email protected]
diffx [email protected]:owner/[email protected]@gitlab.com:owner/fork.git@feature

GitHub refs and URLs

# GitHub ref shorthand
diffx github:owner/[email protected]

# PR reference
diffx github:owner/repo#123

# PR URL
diffx https://github.com/owner/repo/pull/123

# PR vs PR
diffx github:owner/repo#123..github:owner/repo#456

# Commit URL
diffx https://github.com/owner/repo/commit/abc123

# PR changes URL
diffx https://github.com/owner/repo/pull/123/changes/abc123..def456

# Compare URL (same repo or cross-fork)
diffx https://github.com/owner/repo/compare/main...feature
diffx https://github.com/owner/repo/compare/main...other-owner:other-repo:feature

GitLab refs

# GitLab shorthand range
diffx gitlab:owner/[email protected]

# Merge request ref
diffx gitlab:owner/repo!123

Two-dot vs three-dot

diffx supports both .. and ... for ref-to-ref range inputs such as local refs, remote shorthand refs, git URL ranges, and github: / gitlab: ref ranges.

  • A..B compares the two tips directly (same as git diff A B)
  • A...B compares from the merge-base of A and B to B (same as git diff A...B)

Some URL-based inputs use a fixed form instead:

  • GitHub compare URLs use ..., e.g. diffx https://github.com/owner/repo/compare/main...feature
  • GitHub PR changes URLs use .., e.g. diffx https://github.com/owner/repo/pull/123/changes/abc123..def456
  • GitHub PR URLs, GitHub commit URLs, and GitLab MR refs are single-resource inputs, e.g. diffx https://github.com/owner/repo/pull/123, diffx https://github.com/owner/repo/commit/abc123, diffx gitlab:owner/repo!123
  • PR-to-PR inputs accept both separators, but currently treat them the same, e.g. diffx github:owner/repo#123..github:owner/repo#456

Output Modes

diffx defaults to diff mode.

  • diff: unified diff output.
  • patch: patch output (for git apply style use).
  • stat: per-file histogram + summary line.
  • numstat: tab-delimited additions/deletions per file.
  • shortstat: one summary line only.
  • name-only: changed filenames only.
  • name-status: status + filename (e.g. M, A, D, U).
  • summary: structural summary (create mode, rename, etc.), equivalent to git diff --summary.

Examples:

diffx main..feature --mode patch
diffx https://github.com/owner/repo/pull/123 --stat
diffx --name-status

Filtering

# Include only TypeScript files
diffx main..feature --include "src/**/*.ts"

# Exclude tests
diffx main..feature --exclude "**/*.test.ts"

# Combine include + exclude
diffx main..feature --include "src/**" --exclude "**/*.spec.ts"

# Repeat include/exclude flags (matches any include; excludes any exclude)
diffx --include "*.ts" --include "*.tsx" --exclude "*.js" --exclude "*.jsx"

Pager behavior

  • Diff/patch output auto-pages on TTY (git-like behavior).
  • Honors GIT_PAGER, core.pager, PAGER.
  • Use --pager to force paging.
  • Use --no-pager to disable paging.

Options Reference

| Option | Short | Description | | --------------------- | ----- | ---------------------------------------------------------------------------------------------------------- | | --mode <mode> | | Select output mode: diff, patch, stat, numstat, shortstat, name-only, name-status, summary | | --stat | | Shortcut for stat output | | --numstat | | Shortcut for numstat output | | --summary | | Structural summary (native git diff --summary) | | --shortstat | | Shortcut for shortstat output | | --name-only | | Show filenames only | | --name-status | | Show status + filename | | --include <pattern> | -i | Include only files matching glob (repeatable) | | --exclude <pattern> | -e | Exclude files matching glob (repeatable) | | --pager | | Force pager | | --no-pager | | Disable pager | | --index | | Strict git diff compatibility mode | | --help | -h | Show help | | --version | -v | Show version |

Git Pass-through Compatibility

diffx forwards unknown/standard git diff flags to git when possible, including pathspec support after --.

diffx main..feature -U10 --word-diff

diffx --stat -- src/cli src/utils

This allows existing git diff habits while still using diffx input resolution and workflows.

Exit Codes

| Code | Meaning | | ---- | ---------------------------------------- | | 0 | Success | | 1 | No files matched filters | | 2 | Invalid input / unsupported range format | | 3 | Git execution/fetch error |

Development

This repository uses bun.

bun install
bun run build
bun run test
bun run test:e2e
bun run lint
bun run typecheck

License

MIT