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

@bybrave/prompts2

v3.0.0

Published

Maintained fork of prompts — lightweight, beautiful and user-friendly interactive prompts

Downloads

155

Readme

@bybrave/prompts2

CI npm node types license

Maintained fork of prompts — lightweight, beautiful and user-friendly interactive prompts for the terminal.

Why this fork

The original prompts has not been released since 2021 while very real papercuts kept piling up. This fork is a drop-in replacement that fixes them:

| Change | Upstream issue | |---|---| | Ctrl+C terminates the process (re-raises SIGINT after restoring the terminal) instead of silently continuing with partial answers; opt out with exitOnCtrlC: false | #252 | | Cancelling a prompt no longer hangs the process: tearing down readline from inside its own keypress event left stdin in a state that kept the event loop alive forever | #87 | | Native ESM entry point: import prompts from '@bybrave/prompts2' works without interop warnings | #393 | | Types wired into the exports map, so TypeScript resolves them under node16/bundler resolution | #388 | | Modernized: Node ≥ 18, tests on node:test (zero test deps), CI on Node 18/20/22 | — |

Install

npm install @bybrave/prompts2

Usage

const prompts = require('@bybrave/prompts2');
// or: import prompts from '@bybrave/prompts2';

const response = await prompts({
  type: 'number',
  name: 'value',
  message: 'How old are you?',
  validate: (value) => (value < 18 ? 'Nightclub is 18+ only' : true),
});

console.log(response.value);

All 12 prompt types (text, password, invisible, number, confirm, list, toggle, select, multiselect, autocompleteMultiselect, autocomplete, date), chaining, dynamic prompts, onState/onRender, inject and override work exactly as documented in the original README — the API is unchanged.

Ctrl+C behaviour

Pressing Ctrl+C now cleans up the terminal (cursor restored, raw mode off) and re-raises SIGINT, so your process terminates — or your own SIGINT handler runs. This is what users expect from a CLI and what the upstream maintainer planned for the next major.

To keep the old soft-cancel behaviour (prompt aborts, program continues via onCancel) for a specific question:

const response = await prompts({
  type: 'confirm',
  name: 'ok',
  message: 'Continue?',
  exitOnCtrlC: false,
});

Esc and Ctrl+D remain soft cancels in both modes.

Migrating from prompts

- const prompts = require('prompts');
+ const prompts = require('@bybrave/prompts2');

Breaking changes vs prompts@2:

  • Ctrl+C terminates the process by default (opt out per question with exitOnCtrlC: false)
  • Node ≥ 18 required
  • The legacy dist/ build for Node 6 was removed

Support

If this package saves you time, you can support maintenance:

Ko-fi Bitcoin

Bitcoin (BTC): bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q

Credits & license

MIT. Based on prompts by Terkel Gjervig.