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

testbump

v2.0.7

Published

The versioning tool that will tell you if you broke your own contracts.

Readme

cd dependencies style coverage version node license

testbump

The versioning tool that will tell you if you broke your own contracts.

testbump determines your semantic version based purely on the principle that your test suite is the versioning contract. No AST parsing, no complex rules, no dependency hell. Just pure Test-Driven Bumps (TDB) using Node and Git.

The Logic Matrix

Let C = Code, T = Tests. Let old = Last Git Tag, new = Current HEAD.

💥 MAJOR (Breaking): T(old) fails on C(new). (You broke a previously guaranteed contract).

MINOR (Feature): T(old) passes on C(new) AND T(new) fails on C(old). (Old contracts are intact, but you added new tests/contracts that old code cannot fulfill).

🩹 PATCH (Fix): T(old) passes on C(new) AND T(new) passes on C(old). (Old contracts are intact, and no new code surface was tested).

How it Works (Under the Hood)

testbump doesn't parse ASTs or guess your intentions. It uses Git Worktrees to time-travel. It creates hidden, parallel worktrees of your last tagged release and physically overlays your new code. It dynamically synthesizes a hybrid package.json to ensure your new code gets its new dependencies, while your old tests get their historical testing frameworks. Then, it runs the matrix.

Example: The Unintentional Breaking Change

// v1.0.0 Code
export const fetchUser = () => ({ status: 'Not Found' })

// v1.0.0 Test
test('user missing', () => equal(fetchUser().status, 'Not Found'))

// --- You refactor for v2 ---

// HEAD Code
export const fetchUser = () => ({ status: 'User Not Found' })

You might think this is a patch. testbump runs the v1.0.0 test against your HEAD code. It fails. testbump bumps you to v2.0.0. You broke the contract.

Usage

Run it in your CI or locally to get the next version bump

npx testbump # outputs: major, minor, or patch

Chain it directly into npm

npm version $(npx testbump)

Initialize your project automatically

npx testbump --init # updates package.json .scripts.bump and creates first git tag

Setup

testbump requires a Baseline Contract (an initial git tag) to compare future code against.

  1. Initialize your project: Ensure your package.json has a test script that uses the native Node test runner.
    "scripts": {
      "test": "node --test",
      "bump": "npm version $(npx testbump)"
    }
  2. Write your first code & tests.
  3. Establish the Baseline Contract: Commit your work and create your first manual tag.
    git add .
    git commit -m "initial commit"
    git tag 0.0.1  # Or something like `npm version $(jq -r .version package.json) --allow-same-version`
  4. Let testbump take the wheel: From now on, just run npm run bump when you want to release! Or have the CI do it!

Programmatic API

testbump isn't just a CLI. It's completely decoupled, meaning you can integrate it directly into your own Node-based CI/CD pipelines, bots, or release scripts.

import { bump, init } from 'testbump'
import { cwd } from 'node:process'

// Returns 'major', 'minor', or 'patch'
const nextVersion = await bump(cwd(), {
  verbose: true,
  globs: ['test/**/*.test.js'] // Optionally scope your contracts
})

GitHub Actions

We use testbump to version testbump. It is completely automated. Feel free to copy our GitHub Actions to completely remove human versioning from your repositories:

1. The PR Preview Bot (ci.yml) On every Pull Request, our CI runs the testbump matrix and dynamically calculates the future version. It uses the GitHub API to create a custom Check Run showing exactly what the bump will be (🔴 MAJOR, 🟠 MINOR, or 🟢 PATCH) and automatically adds the corresponding label to the PR.

2. The Gatekeeper Auto-Release (cd.yml) On push to main, the CD pipeline creates two npm pack tarballs (one for the current HEAD and one for the last Git Tag). It diffs the raw payloads.

  • If nothing changed (e.g., just a .npmignore'd update), it exits.
  • If the artifact drifted, it runs npm run bump, pushes the new Git tag, publishes to NPM with provenance, and creates a GitHub Release.

Documentation

Dive deeper into the architecture, philosophy, and advanced mechanics of testbump:

Requirements

  • Git
  • Node LTS
  • Tests written using the native node:test runner.

License

WTFNMFPL