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

@spikedpunch/cbd-japa

v0.0.4

Published

japa adapter: turns a plain japa run into per-test coverage windows, and selects with them.

Readme

@spikedpunch/cbd-japa

The japa adapter for CBD. It turns a plain japa run into per-test coverage windows, and narrows a run to the tests a change reaches.

Install

pnpm add -D @spikedpunch/cbd-japa @spikedpunch/cbd @spikedpunch/cbd-cli

Peer dependency: @japa/runner >=5 <6.

Setup

Add the plugin to the configure call you already have:

import { configure, processCLIArgs, run } from '@japa/runner'
import { cbd } from '@spikedpunch/cbd-japa'

processCLIArgs(process.argv.slice(2))
configure({
  files: ['tests/**/*.spec.js'],
  plugins: [cbd()],
})
await run()

With CBD_SHARD unset the plugin is inert, so the line can be committed and ordinary runs are unaffected. cbd collect sets the variable for the run it spawns:

pnpm exec cbd collect -- pnpm test

Recording

The plugin installs japa's test-start/test-end hooks and writes shard records to CBD_SHARD. japa exposes its emitter to plugins directly, so no patching and no /auto entry is needed.

A service the suite drives

When CBD_SOCKET_DIR is set, the plugin records the instrumented service as well as the test process, and writes its windows to a sibling *.service.ndjson shard. The service is instrumented by running it with CBD's module:

NODE_OPTIONS="--import @spikedpunch/cbd/instrument" \
CBD_SOCKET_DIR=/tmp/cbd-sockets \
node server.js

A configured service that cannot be reached is an error, not a silent skip: a map that omits the server would escalate every server-side change to a full run, and skipping quietly reproduces exactly the problem CBD exists to avoid.

Deployed copies (a lane, a container image) can be mapped back to the checkout with CBD_RELOCATE_FROM / CBD_RELOCATE_TO, so the map is keyed by repository paths.

Selection

CBD_SELECTION (a JSON file { "titles": string[] }) narrows the run to those bare japa titles; cbd collect writes it before spawning the run. You can also pass titles explicitly:

configure({ plugins: [cbd({ only: ['adds two numbers'] })] })

An explicit only wins over the environment. Recording and selection are independent: selection can run without recording, and recording without selection.

Options

cbd({
  enabled: true,        // false makes the plugin a no-op without removing it
  shard: process.env.CBD_SHARD,
  commit: process.env.CBD_COMMIT,
  scan: undefined,      // advanced: projection/relocation/filter rules
  only: undefined,      // bare japa titles to run
})

Notes

  • Test identity is the suite path plus the test name (outer > inner > adds) and the file, so two same-named tests in one file stay distinct.
  • A statically skipped test opens no window.
  • Selection titles are bare japa titles; a fully qualified title matches nothing in japa's filter.

See CBD.md for the window model and safety rules, and the root README for the CLI and config.