enquirer
Stylish, user-friendly command-line prompts for interactive Node.js tools.
enquirer
General JSStylish, user-friendly command-line prompts for interactive Node.js tools.
Fit
Bundle (gzip)
22.8 kB
74.9 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
Building CLI prompts by hand is tedious and inconsistent, especially when you need support for confirmations, lists, input masks, and validation across many terminal environments.
What It Does
enquirer provides a modern prompt system with expressive question definitions, built-in prompt types, and clean terminal output. It makes interactive command-line workflows easy to configure without pulling in a heavy dependency.
Installation
npm install enquirerUsage Example
import Enquirer from "enquirer";
const enquirer = new Enquirer();
const response = await enquirer.prompt({
type: "input",
name: "email",
message: "Enter your email",
validate(value) {
return value.includes("@") ? true : "Please enter a valid email address.";
},
});
console.log("Email:", response.email);Related packages
Unified TypeScript SDK for building AI-powered apps — switch between 20+ LLM providers without rewriting code.
animejsGeneral JSLightweight JavaScript animation library with a tiny footprint and a powerful, expressive API.
AOSGeneral JSAn easy-to-use library that makes elements fade, slide, or zoom into view as the user scrolls down your page.
archiverGeneral JSStreaming interface for generating ZIP and TAR archives in Node.js — create compressed archives programmatically from files, directories, and buffers.
@formkit/auto-animateGeneral JS> Add smooth transitions to any element with a single line — zero-config animations for adds, removes, and moves.