Gathering detailed insights and metrics for @inquirer/figures
Gathering detailed insights and metrics for @inquirer/figures
Gathering detailed insights and metrics for @inquirer/figures
Gathering detailed insights and metrics for @inquirer/figures
inquirer-figures-gacrux-jekyll
Adexe Created Npm Publish store to check for the client purpose Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
slides-local-inquirer-figures
Adexe Created Npm Publish store to check for the client purpose Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
polaris-inquirer-hexo-figures
Adexe Created Npm Publish store to check for the client purpose Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
impulse-figures-inquirer-oortcloud
Adexe Created Npm Publish store to check for the client purpose Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
A collection of common interactive command line user interfaces.
npm install @inquirer/figures
Typescript
Module System
Min. Node Version
Node Version
NPM Version
@inquirer/prompts@7.5.0
Updated on Apr 24, 2025
inquirer@12.6.0
Updated on Apr 24, 2025
@inquirer/rawlist@4.1.0
Updated on Apr 24, 2025
@inquirer/select@4.2.0
Updated on Apr 24, 2025
inquirer@12.5.2
Updated on Apr 03, 2025
@inquirer/prompts@7.4.1
Updated on Apr 03, 2025
TypeScript (91.62%)
JavaScript (8.38%)
Total Downloads
242,729,903
Last Day
1,667,266
Last Week
8,604,212
Last Month
36,150,016
Last Year
240,019,207
MIT License
20,791 Stars
1,752 Commits
1,321 Forks
150 Watchers
11 Branches
211 Contributors
Updated on May 09, 2025
Minified
Minified + Gzipped
Latest Version
1.0.11
Package Id
@inquirer/figures@1.0.11
Unpacked Size
48.58 kB
Size
5.78 kB
File Count
8
NPM Version
lerna/8.2.1/node@v22.13.0+arm64 (darwin)
Node Version
22.13.0
Published on
Mar 08, 2025
Cumulative downloads
Total Downloads
Last Day
55%
1,667,266
Compared to previous day
Last Week
6.2%
8,604,212
Compared to previous week
Last Month
0.6%
36,150,016
Compared to previous month
Last Year
8,754.5%
240,019,207
Compared to previous year
3
A collection of common interactive command line user interfaces.
Give it a try in your own terminal!
1npx @inquirer/demo@latest
npm | yarn |
---|---|
|
|
[!NOTE] Inquirer recently underwent a rewrite from the ground up to reduce the package size and improve performance. The previous version of the package is still maintained (though not actively developed), and offered hundreds of community contributed prompts that might not have been migrated to the latest API. If this is what you're looking for, the previous package is over here.
1import { input } from '@inquirer/prompts'; 2 3const answer = await input({ message: 'Enter your name' });
1import { input } from '@inquirer/prompts';
See documentation for usage example and options documentation.
1import { select } from '@inquirer/prompts';
See documentation for usage example and options documentation.
1import { checkbox } from '@inquirer/prompts';
See documentation for usage example and options documentation.
1import { confirm } from '@inquirer/prompts';
See documentation for usage example and options documentation.
1import { search } from '@inquirer/prompts';
See documentation for usage example and options documentation.
1import { password } from '@inquirer/prompts';
See documentation for usage example and options documentation.
1import { expand } from '@inquirer/prompts';
See documentation for usage example and options documentation.
Launches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.)
1import { editor } from '@inquirer/prompts';
See documentation for usage example and options documentation.
Very similar to the input
prompt, but with built-in number validation configuration option.
1import { number } from '@inquirer/prompts';
See documentation for usage example and options documentation.
1import { rawlist } from '@inquirer/prompts';
See documentation for usage example and options documentation.
The API documentation is over here, and our testing utilities here.
All inquirer prompts are a function taking 2 arguments. The first argument is the prompt configuration (unique to each prompt). The second is providing contextual or runtime configuration.
The context options are:
Property | Type | Required | Description |
---|---|---|---|
input | NodeJS.ReadableStream | no | The stdin stream (defaults to process.stdin ) |
output | NodeJS.WritableStream | no | The stdout stream (defaults to process.stdout ) |
clearPromptOnDone | boolean | no | If true, we'll clear the screen after the prompt is answered |
signal | AbortSignal | no | An AbortSignal to cancel prompts asynchronously |
Example:
1import { confirm } from '@inquirer/prompts'; 2 3const allowEmail = await confirm( 4 { message: 'Do you allow us to send you email?' }, 5 { 6 output: new Stream.Writable({ 7 write(chunk, _encoding, next) { 8 // Do something 9 next(); 10 }, 11 }), 12 clearPromptOnDone: true, 13 }, 14);
This can be done with either an AbortController
or AbortSignal
.
1// Example 1: using built-in AbortSignal utilities 2import { confirm } from '@inquirer/prompts'; 3 4const answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) });
1// Example 2: implementing custom cancellation with an AbortController 2import { confirm } from '@inquirer/prompts'; 3 4const controller = new AbortController(); 5setTimeout(() => { 6 controller.abort(); // This will reject the promise 7}, 5000); 8 9const answer = await confirm({ ... }, { signal: controller.signal });
ctrl+c
gracefullyWhen a user press ctrl+c
to exit a prompt, Inquirer rejects the prompt promise. This is the expected behavior in order to allow your program to teardown/cleanup its environment. When using async/await
, rejected promises throw their error. When unhandled, those errors print their stack trace in your user's terminal.
ExitPromptError: User force closed the prompt with 0 null
at file://example/packages/core/dist/esm/lib/create-prompt.js:55:20
at Emitter.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:67:19)
at #processEmit (file://example/node_modules/signal-exit/dist/mjs/index.js:236:27)
at #process.emit (file://example/node_modules/signal-exit/dist/mjs/index.js:187:37)
at process.callbackTrampoline (node:internal/async_hooks:130:17)
This isn't a great UX, which is why we highly recommend you to handle those errors gracefully.
First option is to wrap your scripts in try/catch
; like we do in our demo program. Or handle the error in your CLI framework mechanism; for example Clipanion catch
method.
Lastly, you could handle the error globally with an event listener and silence it.
1process.on('uncaughtException', (error) => { 2 if (error instanceof Error && error.name === 'ExitPromptError') { 3 console.log('👋 until next time!'); 4 } else { 5 // Rethrow unknown errors 6 throw error; 7 } 8});
When asking many questions, you might not want to keep one variable per answer everywhere. In which case, you can put the answer inside an object.
1import { input, confirm } from '@inquirer/prompts'; 2 3const answers = { 4 firstName: await input({ message: "What's your first name?" }), 5 allowEmail: await confirm({ message: 'Do you allow us to send you email?' }), 6}; 7 8console.log(answers.firstName);
Maybe some questions depend on some other question's answer.
1import { input, confirm } from '@inquirer/prompts'; 2 3const allowEmail = await confirm({ message: 'Do you allow us to send you email?' }); 4 5let email; 6if (allowEmail) { 7 email = await input({ message: 'What is your email address' }); 8}
1import { input } from '@inquirer/prompts'; 2 3const answer = await input( 4 { message: 'Enter a value (timing out in 5 seconds)' }, 5 { signal: AbortSignal.timeout(5000) }, 6).catch((error) => { 7 if (error.name === 'AbortPromptError') { 8 return 'Default value'; 9 } 10 11 throw error; 12});
By default scripts ran from tools like husky
/lint-staged
might not run inside an interactive shell. In non-interactive shell, Inquirer cannot run, and users cannot send keypress events to the process.
For it to work, you must make sure you start a tty
(or "interactive" input stream.)
If those scripts are set within your package.json
, you can define the stream like so:
1 "precommit": "my-script < /dev/tty"
Or if in a shell script file, you'll do it like so: (on Windows that's likely your only option)
1#!/bin/sh 2exec < /dev/tty 3 4node my-script.js
When using inquirer prompts with nodemon, you need to pass the --no-stdin
flag for everything to work as expected.
1npx nodemon ./packages/demo/demos/password.mjs --no-stdin
Note that for most of you, you'll be able to use the new watch-mode built-in Node. This mode works out of the box with inquirer.
1# One of depending on your need 2node --watch script.js 3node --watch-path=packages/ packages/demo/
Maybe some question configuration require to await a value.
1import { confirm } from '@inquirer/prompts'; 2 3const answer = await confirm({ message: await getMessage() });
npx
within bash scriptsYou can use Inquirer prompts directly in the shell via npx
, which is useful for quick scripts or package.json
commands.
A community library, @inquirer-cli, exposes each prompt as a standalone CLI.
For example, to prompt for input:
1name=$(npx -y @inquirer-cli/input -r "What is your name?") 2echo "Hello, $name!"
Or to create an interactive version bump:
1$ npm version $(npx -y @inquirer-cli/select -c patch -c minor -c major 'Select Version')
Find out more: @inquirer-cli.
If you created a cool prompt, send us a PR adding it to the list below!
Interactive List Prompt
Select a choice either with arrow keys + Enter or by pressing a key associated with a choice.
? Choose an option:
> Run command (D)
Quit (Q)
Action Select Prompt
Choose an item from a list and choose an action to take by pressing a key.
? Choose a file Open <O> Edit <E> Delete <X>
❯ image.png
audio.mp3
code.py
Table Multiple Prompt
Select multiple answer from a table display.
1Choose between choices? (Press <space> to select, <Up and Down> to move rows, 2<Left and Right> to move columns) 3 4┌──────────┬───────┬───────┐ 5│ 1-2 of 2 │ Yes? │ No? | 6├──────────┼───────┼───────┤ 7│ Choice 1 │ [ ◯ ] │ ◯ | 8├──────────┼───────┼───────┤ 9│ Choice 2 │ ◯ │ ◯ | 10└──────────┴───────┴───────┘ 11
Toggle Prompt
Confirm with a toggle. Select a choice with arrow keys + Enter.
? Do you want to continue? no / yes
Sortable Checkbox Prompt
The same as built-in checkbox prompt, but also allowing to reorder choices using ctrl+up/down.
? Which PRs and in what order would you like to merge? (Press <space> to select, <a> to toggle all, <i> to invert selection, <ctrl+up> to move item up, <ctrl+down> to move item down, and <enter> to proceed)
❯ ◯ PR 1
◯ PR 2
◯ PR 3
An inquirer select that supports multiple selections and filtering/searching.
? Choose your OS, IDE, PL, etc. (Press <tab> to select/deselect, <backspace> to remove selected
option, <enter> to select option)
>> vue
>[ ] vue
[ ] vuejs
[ ] fuelphp
[ ] venv
[ ] vercel
(Use arrow keys to reveal more options)
File Selector Prompt
A file selector, you can navigate freely between directories, choose what type of files you want to allow and it is fully customizable.
1? Select a file: 2/main/path/ 3├── folder1/ 4├── folder2/ 5├── folder3/ 6├── file1.txt 7├── file2.pdf 8└── file3.jpg (not allowed) 9━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10Use ↑↓ to navigate through the list 11Press <esc> to navigate to the parent directory 12Press <enter> to select a file or navigate to a directory
Copyright (c) 2023 Simon Boudrias (twitter: @vaxilart)
Licensed under the MIT license.
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
SAST tool detected but not run on all commits
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 1/10 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More