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

speedy-prompt

v1.1.0

Published

A fast and efficient prompt library for Node.js

Downloads

22

Readme

Speedy Prompt

A fast and efficient prompt library for Node.js with type-safe input handling and interactive selection menus.


Features

  • Type-safe prompts - String, number, boolean, and custom types with full TypeScript support
  • Interactive selection - Navigate through choices with keyboard controls
  • Input validation - Built-in validation with custom validators
  • Password masking - Hide sensitive input with custom mask characters
  • Flexible layouts - Horizontal or vertical selection menu layouts
  • Lightweight - Zero dependencies, minimal footprint

Installation

# npm
npm install speedy-prompt

# yarn
yarn add speedy-prompt

# pnpm
pnpm install speedy-prompt

# bun
bun install speedy-prompt

Usage

Basic Text Input

import { prompt } from "speedy-prompt";

const name = await prompt("Enter your name: ", {
  type: "string",
  required: true,
});

console.log("Hello,", name);

Number Input

const age = await prompt("Enter your age: ", {
  type: "number",
  required: true,
  validate: (value) => value < 0 ? "Age must be positive" : null,
});

Boolean Input

const isAdmin = await prompt("Are you admin? ", {
  type: "boolean",
  required: true,
});

Password Input

const password = await prompt("Enter password: ", {
  type: "string",
  mask: "*",
  required: true,
});

Selection Menu (Horizontal)

import { promptSelect } from "speedy-prompt";

const color = await promptSelect("Choose a color:", [
  "Red",
  "Green",
  "Blue",
]);

Selection Menu (Vertical)

const country = await promptSelect("Where are you from?", [
  "Brazil",
  "Portugal",
  "USA",
  "Germany",
  "France",
], {
  vertical: true,
});

Complete Example

import { prompt, promptSelect } from "speedy-prompt";

(async () => {
  const name = await prompt("Enter your name: ", {
    type: "string",
    required: true,
  });

  const age = await prompt("Enter your age: ", {
    type: "number",
    required: true,
  });

  const isAdmin = await prompt("Are you admin? ", {
    type: "boolean",
    required: true,
  });

  const color = await promptSelect("Choose a color:", [
    "Red",
    "Green",
    "Blue",
  ], {
    vertical: true,
  });

  console.log({ name, age, isAdmin, color });
})();

API

prompt(label, options?)

Creates a text-based input prompt.

Parameters:

  • label (string) - The prompt label/question
  • options (PromptOptions) - Optional configuration:
    • type - Input type: "string" | "number" | "boolean" | "any" (default: "any")
    • required - Whether input is required (default: false)
    • mask - Character to mask input (e.g., "*" for passwords)
    • defaultValue - Default value if user presses Enter
    • validate - Custom validation function returning error message or null

Returns: Promise<T> - The parsed input value

promptSelect(label, choices, options?)

Creates an interactive selection menu.

Parameters:

  • label (string) - The menu label/question
  • choices (T[]) - Array of selectable options
  • options (SelectOptions) - Optional configuration:
    • vertical - Display choices vertically (default: false)
    • highlightColor - ANSI color code for highlighting (default: cyan)

Returns: Promise<T> - The selected choice


Keyboard Controls

Text Input

  • Enter - Submit input
  • Backspace - Delete character
  • Ctrl+C - Exit

Boolean Input

  • Left Arrow - Select "Yes"
  • Right Arrow - Select "No"
  • Enter - Submit
  • Ctrl+C - Exit

Selection Menu (Horizontal)

  • Left/Right Arrow - Navigate choices
  • Enter - Select
  • Ctrl+C - Exit

Selection Menu (Vertical)

  • Up/Down Arrow - Navigate choices
  • Enter - Select
  • Ctrl+C - Exit

License

Speedy Prompt is licensed under the MIT License.


Contributing

We welcome contributions from the community! If you'd like to contribute, please follow these steps:

  1. Star the repository
  2. Fork the repository
  3. Create a new branch for your feature or bug fix
  4. Make your changes and commit them
  5. Push your changes to your fork
  6. Submit a pull request

Support

If you need help or have any questions, please feel free to open an issue on GitHub Issues.