{"_id":"@bybrave/prompts2","name":"@bybrave/prompts2","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@bybrave/prompts2","version":"3.0.0","description":"Maintained fork of prompts — lightweight, beautiful and user-friendly interactive prompts","main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"},"./package.json":"./package.json","./lib/*":"./lib/*"},"scripts":{"test":"node --test test/*.test.js test/*.test.mjs","test-types":"tsc --noEmit --strict test/type-declarations.ts"},"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/prompts2.git"},"bugs":{"url":"https://github.com/bybraveHQ/prompts2/issues"},"homepage":"https://github.com/bybraveHQ/prompts2#readme","keywords":["prompts","prompt","cli","interactive","command-line","input","stdin","menu","ask","typescript","esm"],"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"contributors":[{"name":"Terkel Gjervig","email":"terkel@terkel.com","url":"author of the original prompts"}],"license":"MIT","funding":"https://ko-fi.com/bybrave","engines":{"node":">=18"},"dependencies":{"kleur":"^4.1.5","sisteransi":"^1.0.5"},"devDependencies":{"@types/node":"^20.14.0","typescript":"^5.5.0"},"_id":"@bybrave/prompts2@3.0.0","gitHead":"f096eab7c4c71b4b02b26c1c522388abd7b812b9","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-f/noNm0g43pPMnj/oErwPtL4KM9gecFJgiv/yC4y3I5xt9VEIsXUfJiyNCCZKwPlT0TrVwAnLfRCS5IWJ4I9cg==","shasum":"aafa45c951149916f59c4182e147d286e30921de","tarball":"https://registry.npmjs.org/@bybrave/prompts2/-/prompts2-3.0.0.tgz","fileCount":38,"unpackedSize":84699,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCYTkLXxe6cB1H2c+VxfrQDaUdykw2OCeud55cjjOKcNwIhAPAD1+OifNq/hF3Qa9cQg77r+1uuCZv43v6RH6rc1zFM"}]},"_npmUser":{"name":"bybrave","email":"opmybrave@gmail.com"},"directories":{},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prompts2_3.0.0_1783203549611_0.013963277117726047"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-04T22:19:09.433Z","3.0.0":"2026-07-04T22:19:09.729Z","modified":"2026-07-04T22:19:09.933Z"},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"description":"Maintained fork of prompts — lightweight, beautiful and user-friendly interactive prompts","homepage":"https://github.com/bybraveHQ/prompts2#readme","keywords":["prompts","prompt","cli","interactive","command-line","input","stdin","menu","ask","typescript","esm"],"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/prompts2.git"},"contributors":[{"name":"Terkel Gjervig","email":"terkel@terkel.com","url":"author of the original prompts"}],"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"bugs":{"url":"https://github.com/bybraveHQ/prompts2/issues"},"license":"MIT","readme":"# @bybrave/prompts2\n\n[![CI](https://github.com/bybraveHQ/prompts2/actions/workflows/ci.yml/badge.svg)](https://github.com/bybraveHQ/prompts2/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/@bybrave/prompts2.svg)](https://www.npmjs.com/package/@bybrave/prompts2)\n[![node](https://img.shields.io/node/v/@bybrave/prompts2.svg?color=339933&logo=node.js&logoColor=white)](https://www.npmjs.com/package/@bybrave/prompts2)\n[![types](https://img.shields.io/badge/types-included-3178C6?logo=typescript&logoColor=white)](index.d.ts)\n[![license](https://img.shields.io/npm/l/@bybrave/prompts2.svg?color=blue)](LICENSE)\n\nMaintained fork of [prompts](https://github.com/terkelg/prompts) — lightweight, beautiful and user-friendly interactive prompts for the terminal.\n\n## Why this fork\n\nThe 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:\n\n| Change | Upstream issue |\n|---|---|\n| **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](https://github.com/terkelg/prompts/issues/252) |\n| **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](https://github.com/terkelg/prompts/issues/87) |\n| **Native ESM entry point**: `import prompts from '@bybrave/prompts2'` works without interop warnings | [#393](https://github.com/terkelg/prompts/issues/393) |\n| Types wired into the `exports` map, so TypeScript resolves them under `node16`/`bundler` resolution | [#388](https://github.com/terkelg/prompts/issues/388) |\n| Modernized: Node ≥ 18, tests on `node:test` (zero test deps), CI on Node 18/20/22 | — |\n\n## Install\n\n```sh\nnpm install @bybrave/prompts2\n```\n\n## Usage\n\n```js\nconst prompts = require('@bybrave/prompts2');\n// or: import prompts from '@bybrave/prompts2';\n\nconst response = await prompts({\n  type: 'number',\n  name: 'value',\n  message: 'How old are you?',\n  validate: (value) => (value < 18 ? 'Nightclub is 18+ only' : true),\n});\n\nconsole.log(response.value);\n```\n\nAll 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](https://github.com/terkelg/prompts#readme) — the API is unchanged.\n\n## Ctrl+C behaviour\n\nPressing 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.\n\nTo keep the old soft-cancel behaviour (prompt aborts, program continues via `onCancel`) for a specific question:\n\n```js\nconst response = await prompts({\n  type: 'confirm',\n  name: 'ok',\n  message: 'Continue?',\n  exitOnCtrlC: false,\n});\n```\n\nEsc and Ctrl+D remain soft cancels in both modes.\n\n## Migrating from prompts\n\n```diff\n- const prompts = require('prompts');\n+ const prompts = require('@bybrave/prompts2');\n```\n\nBreaking changes vs `prompts@2`:\n\n- Ctrl+C terminates the process by default (opt out per question with `exitOnCtrlC: false`)\n- Node ≥ 18 required\n- The legacy `dist/` build for Node 6 was removed\n\n## Support\n\nIf this package saves you time, you can support maintenance:\n\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-buy%20me%20a%20coffee-FF5E5B?logo=kofi&logoColor=white)](https://ko-fi.com/bybrave)\n[![Bitcoin](https://img.shields.io/badge/Bitcoin-BTC-F7931A?logo=bitcoin&logoColor=white)](#support)\n\nBitcoin (BTC): `bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q`\n\n## Credits & license\n\nMIT. Based on [prompts](https://github.com/terkelg/prompts) by Terkel Gjervig.\n","readmeFilename":"README.md","_rev":"1-8280a2e4df6b1439231f507806c050c7"}