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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@stephen-shopopop/tbx

v0.14.0

Published

node:test wrapper

Downloads

111

Readme

tbx

Runner is a wrapper test runner for node:test.

Runner is self-hosted, i.e. Runner runs its own tests.

Install

npm i @stephen-shopopop/tbx --save-dev

Usage

javascript

tbx

Runner will automatically run all tests files matching *.test.{js}.

typescript

tbxts

Run multiple specify files

tbx *.test.js *.test.mjs

Runner will automatically run all tests files matching *.test.{js|ts}.

Options

  • --concurrency or -c, to set the number of concurrent tests. Defaults to the number of available CPUs minus one.
  • --coverage or -C, enables code coverage. Default is false
  • --watch or -w, re-run tests on changes. Default is false
  • --only or -o, only run node:test with the only option set. Default is false
  • --forceExit or -F, finished executing even if the event loop would otherwise remain active. Default is false
  • --expose-gc, exposes the gc() function to tests. Default is false
  • --reporter or -r, set up a reporter
  • --pattern or -p, run tests matching the given glob pattern. Default is *.test.{js|ts}
  • --name, run tests name matching the given glob pattern. Default is undefined. ex: --name="#myTag"
  • --timeout or -t, timeouts the tests after a given time. Default is 30000ms
  • --lines, set the lines threshold when check coverage is active; default is 80
  • --functions, set the functions threshold when check coverage is active; default is 80
  • --branches, set the branches threshold when check coverage is active; default is 80
  • --rootDir, set rootDir to setup and teardown.

Reporters

Here are the available reporters:

  • tap: outputs the test results in the TAP format.
  • spec: outputs the test results in a human-readable format.
  • dot: outputs the test results in a compact format, where each passing test is represented by a ., and each failing test is represented by a X.
  • junit: outputs test results in a jUnit XML format

Setup

.
├── src
│   └── lib
│      ├── math.ts
│      └── math.test.ts
├── test <rootDir>
│   ├── setup.js
│   ├── teardown.js
│   └── components
│       └── compute.test.ts
└── tsconfig.json (typescript project)

Create file setup.js

// ️️️✅ Best Practice: force UTC
process.env.TZ = 'UTC';


export default function () {
  console.time('global-setup');

  // ... Put your setup

  // 👍🏼 We're ready
  console.timeEnd('global-setup');
}

Teardown

Create file teardown.js

export default function () {
  console.time('global-teardown');

  // ... Put your teardown

  // 👍🏼 We're ready
  console.timeEnd('global-teardown');
}

Documentation

Reference