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

diffbrief

v0.1.0

Published

Turn large (often AI-generated) pull requests into a risk-ranked review brief. Flags auth changes, destructive migrations, secrets, risky dependencies and removed tests, collapses noise, and tells reviewers what to read first. Terminal, Markdown, JSON and

Readme

diffbrief

Turn a large pull request into a risk-ranked review brief. Know what to read first.

npm node license

AI agents can write 1,500 lines in an afternoon. Nobody can review that line by line. diffbrief reads your branch's diff and tells reviewers where the risk is: auth changes, destructive migrations, leaked secrets, risky dependencies, removed tests. It collapses the noise (lockfiles, generated code, formatting).

$ npx diffbrief

diffbrief · main...HEAD · 47 files · +1,912 −388 · Risk: HIGH

HIGH  Review first (2)
  db/migrations/0042_cleanup.sql  +3 −0 · data · new
    ✖ Destructive schema or data change (hard to undo)  line 1
  src/routes/admin.ts  +1 −1 · api
    ✖ Removed an auth, permission or rate-limit check  removed at old line 1

MEDIUM  Check carefully (2)
  package.json  +2 −1 · deps
    ▲ New dependency: left-pad-ultra@^1.0.0  line 4
    ▲ Major version change: express ^4.19.0 → ^5.0.0  line 3
  src/utils/format.test.ts  +0 −1 · tests
    ▲ 1 test case removed

LOW  Quick look (12)
  src/utils/format.ts  +1 −0 · source
    • TODO / FIXME added  line 2
  …

Collapsed 31: 22 lockfiles/generated · 6 formatting-only · 3 docs
  • Works offline. Rules-based, no API keys, no code leaves your machine.
  • Knows what matters. 20+ rules for security, data, dependencies and tests, plus path-based risk categories.
  • Cuts noise. Lockfiles, build output, snapshots and whitespace-only changes are collapsed.
  • Fits your workflow. Terminal, Markdown (for PR comments), JSON, and GitHub Actions annotations with a job summary.
  • Zero dependencies. Only needs git.

Install

npx diffbrief              # run once
npm i -D diffbrief         # or add to your project

Requires Node.js 20+ and git.

Usage

npx diffbrief                          # current branch vs main (or master)
npx diffbrief --base develop           # compare against another branch
npx diffbrief --working                # include uncommitted changes
npx diffbrief --format markdown --output brief.md
npx diffbrief --fail-on high           # exit 1 if anything is high risk
npx diffbrief --ignore "src/generated/**"

Options

| Flag | Config key | Default | Description | |---|---|---|---| | --base <ref> | base | main, master, origin/main, origin/master | Branch or commit to compare against. diffbrief uses the merge base, like a PR | | --head <ref> | — | HEAD | Branch or commit to review | | --working | — | false | Include uncommitted changes | | --format <type> | format | terminal | terminal, markdown, json or github | | --output <file> | — | stdout | Write the brief to a file | | --fail-on <level> | failOn | never | Exit 1 when overall risk is at least high, medium or low | | --ignore <glob> | ignore | [] | Collapse matching files. Repeatable | | --cwd <dir> | — | . | Repository directory |

Config file

diffbrief.config.json in the repository root:

{
  "base": "develop",
  "failOn": "high",
  "ignore": ["src/generated/**", "fixtures/**"],
  "rules": [
    {
      "id": "no-legacy-client",
      "pattern": "legacyPaymentsClient",
      "level": "medium",
      "message": "Uses the legacy payments client",
      "files": "src/**"
    }
  ]
}

Custom rules match each changed line against pattern (a regular expression, case-insensitive by default). Set "on": "removed" to match removed lines.

GitHub Actions

name: diffbrief
on: pull_request

jobs:
  brief:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0              # diffbrief needs the base branch history
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npx diffbrief --base origin/${{ github.base_ref }} --format github

High findings appear as errors and medium findings as warnings on the changed lines, and the full brief is added to the job summary.

To post the brief as a PR comment:

      - run: npx diffbrief --base origin/${{ github.base_ref }} --format markdown --output brief.md
      - run: gh pr comment ${{ github.event.number }} --body-file brief.md --edit-last || gh pr comment ${{ github.event.number }} --body-file brief.md
        env:
          GH_TOKEN: ${{ github.token }}

What it checks

Risk by path

| Category | Examples | Level | |---|---|---| | security | auth/, session, jwt, permissions, csrf | medium | | data | migrations/, *.sql, schema.prisma, models/ | medium | | config | .github/workflows/, Dockerfile, .env*, Terraform, tsconfig.json | medium | | api | routes/, controllers/, handlers/, *.graphql, OpenAPI | low | | source | everything else | low | | tests, docs | collapsed unless something is wrong | — | | generated | lockfiles, dist/, *.min.js, snapshots | collapsed |

Files over 400 changed lines get a "consider splitting" note.

Rules on changed lines

| Level | Rules | |---|---| | High | private keys, real API keys (AWS, GitHub, Stripe, Slack, Google, npm, Anthropic, OpenAI), TLS verification disabled, DROP / TRUNCATE / destructive migrations, eval / new Function, removed auth or rate-limit checks, dependencies from git/URL, install scripts added | | Medium | hard-coded credentials, shell execution, SQL built with string interpolation, raw HTML (dangerouslySetInnerHTML, innerHTML, v-html), CORS open to any origin, auth switched off, MD5/SHA-1, Math.random() in security code, .only in tests, test cases or test files removed, new runtime dependencies, major version changes | | Low | new dev dependencies, skipped tests, @ts-ignore / eslint-disable, console.log / debugger, TODO / FIXME |

"Removed auth check" only fires when more checks were removed than added in that file, so moving a check around does not trigger it.

Programmatic API

import { createBrief, formatBrief } from "diffbrief";

const brief = createBrief({ base: "main", ignore: ["src/gen/**"] });

console.log(brief.risk);                       // "high" | "medium" | "low" | "none"
for (const file of brief.files) {
  console.log(file.level, file.path, file.findings.map((f) => f.message));
}

console.log(formatBrief(brief, "markdown"));

Also exported: analyzeDiff(files, options) (pure, no git), parseUnifiedDiff(text), classify(path), BUILTIN_RULES.

Roadmap

  • Optional LLM summaries of each risky file (bring your own API key).
  • Built-in sticky PR comment.

License

MIT