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

@berkinduz/bundle-sheriff

v0.0.1

Published

Analyze build artifacts (JS/CSS), calculate sizes (Raw, Gzip, Brotli), and enforce performance budgets.

Readme

bundle-sheriff · Stop shipping bloat.

License npm TypeScript

bundle-sheriff is a zero-config-needed CLI that keeps your bundles lean. It scans your built JS/CSS, measures Raw/Gzip/Brotli sizes, and fails CI when budgets are exceeded—preventing regressions before they hit production.

Why bundle-sheriff?

  • Performance budgets catch bloat before customers do.
  • Automated, repeatable checks in CI stop silent regressions.
  • Works with any bundler—just point it at your build output.

Features

  • Compression support: Raw, Gzip, and Brotli measurements
  • CI/CD ready: non-zero exit on failures
  • Zero config by default, fully configurable via sheriff.config.*
  • TypeScript-first codebase and typings

Installation

npm install -D bundle-sheriff

Usage

Run directly (no global install required):

npx bundle-sheriff check

What you’ll see (example):

┌──────────────────────┬─────────────┬────────┬────────┬────────┐
│ File                 │ Compression │ Actual │ Limit  │ Passed │
├──────────────────────┼─────────────┼────────┼────────┼────────┤
│ dist/app.js          │ gzip        │ 12.3 kB│ 20 kB  │ yes    │
│ dist/styles.css      │ brotli      │ 9.1 kB │ 8 kB   │ no     │
└──────────────────────┴─────────────┴────────┴────────┴────────┘

Exit codes: 0 when all budgets pass; 1 when any rule fails or no rules are defined (to keep CI strict).

Configuration (important)

Create sheriff.config.ts (or .js/.json) in your project root:

// sheriff.config.ts
export default {
  rules: [
    {
      // Glob(s) of files to check
      path: "dist/**/*.js",
      // Human-friendly budget (parsed with bytes)
      maxSize: "150kb",
      // Which size to compare: raw | gzip | brotli (default: gzip)
      compression: "gzip",
    },
    {
      path: "dist/**/*.css",
      maxSize: "120kb",
      compression: "brotli",
    },
  ],
};

BundleRule interface:

interface BundleRule {
  path: string; // Glob pattern for files to check
  maxSize: string; // e.g., "150kb", "1.2mb"
  compression?: "raw" | "gzip" | "brotli"; // default: 'gzip'
}

CI/CD Integration

Add a GitHub Actions workflow (runs after your build):

name: bundle-sheriff

on:
  pull_request:
  push:

jobs:
  check-budgets:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
          cache: npm
      - run: npm ci
      - run: npm run build # your app build that emits dist/
      - run: npx bundle-sheriff check

CI will fail fast if any bundle exceeds its budget.

Roadmap

  • Framework adapters (Next.js, Vite, Remix) for zero-setup defaults
  • Historical tracking to detect regressions over time
  • Machine-readable reports (JSON) for custom dashboards

Stop shipping bloat. Keep your budgets honest with bundle-sheriff.