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

bun-test-cli-harness

v0.1.1

Published

bun:test compatible harness for testing Inquirer & Ink based CLIs

Readme

bun-test-cli-harness

bun:test compatible harness for testing Inquirer & Ink based CLIs. Vendors @inquirer/testing's Screen API and ships a bun.ts entry that mocks every @inquirer/* prompt package via mock.module, so sand-style prompts can be driven programmatically without a PTY.

Install

bun add -d bun-test-cli-harness

Usage

Import the harness once at the top of your test file (before any module that uses @inquirer/prompts) so the mocks register before the CLI under test loads its prompt imports:

import 'bun-test-cli-harness'
import { screen } from 'bun-test-cli-harness'
import { test, expect } from 'bun:test'
import { createCommand } from '../src/commands/create.ts'

test('create-sandstone library flow', async () => {
  const result = createCommand('/abs/path/to/project', { root: false })

  // Each prompt renders synchronously; send input then wait for the
  // transition with `screen.next()`.

  // confirm: library?
  screen.type('y')
  screen.keypress('enter')
  await screen.next()

  // version: default
  screen.keypress('enter')
  await screen.next()

  // …drive remaining prompts the same way.

  await result
}, 180_000)

screen API:

  • screen.type(text) — writes characters to the prompt's stdin and emits keypresses for each one.
  • screen.keypress(key) — emits a single named keypress (e.g. 'enter', 'down', 'up').
  • screen.getScreen() — current prompt text (ANSI stripped).
  • screen.next() — resolves when the next render happens (re-render of the current prompt or the next prompt's first render). The very first prompt's render is available synchronously via getScreen() without next().
  • screen.clear() — automatically called between tests via beforeEach.

Why

bun:test doesn't speak jest.mock, so @inquirer/testing/jest's module mocking doesn't work directly. This package wraps mock.module with the same "mock every @inquirer/* prompt" coverage, so you get the upstream API without writing the boilerplate.

License

MIT — see LICENSE.