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

@kaynooo/cli-bench

v0.2.1

Published

bench: command and HTTP benchmarking with git-ref regression comparison and baseline diffing.

Readme

@kaynooo/cli-bench

bench benchmarks shell commands and HTTP endpoints, compares performance against any git ref in a temporary linked worktree, and diffs saved benchmark JSON baselines with statistical significance testing (Welch's t-test).

bun add -g @kaynooo/cli-bench

| Command | What it does | | --- | --- | | bench -- <cmd...> | benchmark a command (shorthand for bench run) | | bench run -n 20 -w 3 -- <cmd...> | run 3 warmups and 20 timed iterations, printing min, median, mean, stddev, p95, p99, max, a sparkline and a distribution histogram | | bench --cmd "a" --cmd "b" | compare multiple commands side-by-side, ranked fastest first with speedup ratios and Welch's t-test significance | | bench run --min-time 2s --prepare "rm -rf .cache" -- <cmd...> | keep running until at least 2s of timed work completes, running a setup command before each iteration | | bench run --save baseline.json -- <cmd...> | write structured JSON results for later bench diff | | bench compare -- <cmd...> | benchmark <cmd> at HEAD (in a temporary linked git worktree) interleaved with the current working tree, reporting deltas and Welch's t-test p-value | | bench compare --base main --fail-on-regression 10 -- <cmd...> | exit 1 when the working tree has a statistically significant median slowdown over 10% | | bench compare --base v1.0 --head v1.1 -- <cmd...> | compare two git refs directly | | bench http -c 10 -n 100 <url> | concurrent HTTP load test reporting req/s, status code breakdown, error count, transfer size, latency percentiles and distribution bars | | bench http -c 20 -d 5s -H "Accept: application/json" <url> | sustained load test for a fixed duration (-d) instead of a fixed request count (-n) | | bench http -m POST --body '{"ok":true}' --max-error-rate 1 <url> | send a request body (--body / --data) and exit 1 if the failed request percentage exceeds 1% | | bench diff baseline.json current.json | compare two saved benchmark JSON outputs and report per-benchmark median/p95 deltas and regression verdicts (--threshold, default 5%) |

Git-ref comparison (bench compare)

bench compare checks out --base (default HEAD) — and --head when given — into temporary detached git worktrees under the system temp directory. Gitignored .env* files and dependency folders (node_modules, vendor, .venv) are symlinked from the main checkout so commands run without reinstalling dependencies (pass --no-link to isolate completely). Temporary worktrees are always removed on exit or signal interruption.

Warmup and timed runs are interleaved between base and head (alternating order on each pair) to reduce CPU throttling and background drift bias. Significance is tested with a two-tailed Welch's unequal-variances t-test ($\alpha = 0.05$).

JSON output and baselines

Every subcommand accepts --json for machine-readable output, and run, compare, and http accept --save <file> to write the same JSON report to disk. bench diff <baseline.json> <current.json> reads outputs from bench run, bench http, or bench compare (saved via --save or redirected from --json), matches benchmarks by name, and exits 1 when any benchmark's median slows down past --threshold (default 5%).

Exit codes

  • 0: benchmark completed cleanly (no failing regressions or error-rate violations)
  • 1: a command failed, all HTTP requests failed, HTTP error rate exceeded --max-error-rate, or a regression exceeded --fail-on-regression / --threshold
  • 2: usage error, invalid URL/header/JSON, missing file, not inside a git repository, or unknown git ref
  • 127: command could not be started