inquirer
Interactive CLI user interfaces for Node.js — prompt users for input, choices, confirmations, and passwords in terminal tools.
inquirer
General JSInteractive CLI user interfaces for Node.js — prompt users for input, choices, confirmations, and passwords in terminal tools.
Fit
Bundle (gzip)
198.7 kB
383.2 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
Building interactive CLI wizards — project generators, configuration tools, deployment scripts — requires collecting user input via prompts with validation, default values, and conditional logic. Parsing raw readline input is verbose.
What It Does
Inquirer provides a promise-based API for asking questions: text input, password masking, checkboxes, lists, confirmations, and editors. Answers can be validated in real time, and conditional prompts show/hide based on previous answers.
Installation
npm install inquirer
npm install -D @types/inquirerUsage Example
import inquirer from 'inquirer';
const answers = await inquirer.prompt([
{
type: 'input',
name: 'projectName',
message: 'Project name:',
validate: (input) => /^[a-z-]+$/.test(input) || 'Use lowercase letters and hyphens only',
},
{
type: 'list',
name: 'framework',
message: 'Choose a framework:',
choices: ['Next.js', 'Remix', 'Astro', 'SvelteKit'],
},
{
type: 'confirm',
name: 'typescript',
message: 'Use TypeScript?',
default: true,
},
]);
console.log(`Creating ${answers.framework} project: ${answers.projectName}`);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.