Compare Versions - @inquirer/prompts
npm / @inquirer/prompts / Compare Versions
- Fix broken 8.3.1 release process.
- Bump dependencies
- Fix: Keypresses happening before a prompt is rendered are now ignored.
- Fix (checkbox): Element who're both checked and disabled are now always included in the returned array.
- Feat (select/checkbox): Cursor will now hover disabled options of the list; but they still cannot be interacted with. This prevents the cursor jumping ahead in ways that can be confusing.
- Feat: various new theme options to make all prompts content localizable.
Finally, see our new @inquirer/i18n package!
- chore: Switch
wrap-ansiwithfast-wrap-ansi
- feat(
search): Add support fordefault. - feat(
rawlist): Add support fordescriptionof choices. That information is displayed under the list when the choice is highlighted. - Bump dependencies
- Feat:
rawlistnow supportsdefaultoption. - Fix:
selectnow infer return type properly when passing achoicesarray of string literals.
- Fix Typescript not discovering types when
moduleResolutionis set tocommonjs(you probably want to fix that in your project if it's still in your tsconfig)
Release Notes
🚨 Breaking Changes
This is a major release that modernizes the codebase for Node.js ≥ 20.
ESM Only - No More CommonJS Support
Impact: All packages are now ESM-only. CommonJS imports are no longer supported.
If you're on modern Node versions (≥ 20), this should be transparent and have no impact.
Node.js Version Requirement
Minimum Node.js version is now 20.x
Node.js versions below 20 are no longer supported. Please upgrade to Node.js 20 or later.
Node min versions: >=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0
Deprecated APIs Removed
The following deprecated APIs have been removed after being deprecated in previous releases:
list prompt alias removed (affects inquirer package only)
The list alias has been removed from the inquirer package. This only impacts users of the legacy inquirer package, not users of @inquirer/prompts or individual prompt packages.
// ❌ No longer available (inquirer package only)
import inquirer from 'inquirer';
const answer = await inquirer.prompt([
{ type: 'list', name: 'choice', message: 'Pick one:', choices: ['a', 'b'] }
]);
// ✅ Use 'select' instead
import inquirer from 'inquirer';
const answer = await inquirer.prompt([
{ type: 'select', name: 'choice', message: 'Pick one:', choices: ['a', 'b'] }
]);
helpMode theme property removed
// ❌ No longer available
const answer = await select({
theme: { helpMode: 'never' }
});
// ✅ Use theme.style.keysHelpTip instead
const answer = await select({
theme: {
style: {
keysHelpTip: () => undefined // or your custom styling function
}
}
});
This affects the following prompts:
@inquirer/checkbox@inquirer/search@inquirer/select
instructions config property removed
// ❌ No longer available
const answer = await checkbox({
instructions: 'Custom instructions'
});
// ✅ Use theme.style.keysHelpTip instead
const answer = await checkbox({
theme: {
style: {
keysHelpTip: (text) => 'Custom instructions'
}
}
});
This affects the following prompts:
@inquirer/checkbox@inquirer/search@inquirer/select
cancel() method removed
The cancel() method on prompt return custom Promise has been removed.
// ❌ No longer available
const answerPromise = input({ message: 'Name?' });
answerPromise.cancel();
const answer = await answerPromise;
// ✅ Use AbortSignal instead
const controller = new AbortController();
const answer = await input(
{ message: 'Name?' },
{ signal: controller.signal }
);
controller.abort();
Color Library Change: yoctocolors → Node.js styleText
Internal change: The project now uses Node.js built-in util.styleText() instead of the yoctocolors package for terminal colors. This makes Inquirer smaller and reduces risks of vulnerabilities coming from transitive dependencies.
- [Node 18 compat] Downgraded to mute-stream@2 to maintain Node 18 compatibility.
- feat
@inquirer/input: Now support simple RegExp validation withpattern/patternError. - fix
@inquirer/editor: Fix typos/waitForUseInput/waitForUserInput - Bump dependencies
- New design for the keys help tip. Themable/localizable with
theme.style.keysHelpTip. - Re-introduce option to match up/down actions with vim or emacs keybindings. Enable with
theme.keybindings
- Reduce number of transitive dependencies
- Fix #1834: (rawlist) Allows specifying numbers as explicit keys of option within the list.
- fix: Remove "easter-egg" vim/emacs bindings conflicting with the type-to-search feature.
- Fix Unix
yesnot properly being processed by the confirm prompt. (yes | node confirm-script.js)
- Make
@types/nodean optional peer dependency.
- Replace
external-editordependency with new@inquirer/external-editor. This remove the vulnerabletmptransitive dependency from the dependency tree.
- Search prompt: New
instructionsconfig to allow localizing the help tips.
- Fix #1786 select prompt with
indexMode: numbertheme option didn't properly calculate the items indexes if separators where present in between choices.
- Select prompt: When pressing a number key, we'll ignore separators in counting the index of the item to jump to.
- Checkbox prompt: When pressing a number key, we'll ignore separators in counting the index of the item to select.
-input prompt: New prefill option to control if the default value is editable inline or only after pressing tab.
- Fix #1743: pagination logic of the
select,checkboxandsearchprompts was fully rewritten to handle edge cases around rendering multi-line choices and pointer positioning.
- Chore: dependencies bump
- Feat(@inquirer/select): Added an
instructionsoption allowing to customize the messages in the help tips. - Feat(@inquirer/rawlist): Arrow keys will now cycle through the option, just like the
@inquirer/selectprompt. Also added aloopoption to control the list loop behaviour when reaching the boundaries.
- Fix
numberprompt (typescript): If prompt is required, only number can be returned. (previously was nullable) - README: Add new sponsor
- Chore: dependency updates
- Fix an issue where inquirer would throw if Node is ran with the new
--frozen-intrinsicsflag.
This fix is also released through patches of all specific prompts packages.
- Mark
@types/nodeas an optional peer dependency across all packages.
- Hoist peer-dependencies to remove warning when using
yarn
@types/nodeis now only apeerDependencies. This reduces the install size of inquirer dramatically for folks not using Typescript. It's unlikely to break your builds if you used TS already, if it does runnpm install --dev @types/node/yarn add --dev @types/node.
No technical breaking changes; but we changed the style of the question prefix once the answer is provided. Once a question is answer, the prefix becomes a tick mark (previously it was the same ? as when the prompt is idle.)
This is theme-able, and so can be overwritten to with theme.prefix.
- Now includes a
searchprompt.import { search } from @inquirer/prompts
- Now includes a new
numberprompt.
- Replace
chalkwith(in 5.1.0 went topicolorsyoctocolorsto stay with Sindre's packages and reduce amount of provenance.) - TS 5.5 (no impact expected on package users)
- Fix: breaking change wrongly removed the
Separatorexport.
- [Breaking #1384]
@inquirer/coreisn't exported from@inquirer/promptsanymore. If you want to create custom prompts, import from the core package. This decision was made to disambiguate what breaks in each package - with prompts re-exporting core, any core breaking change (no matter how minor) caused a major version bump. Now only prompts interfaces breaking changes will be major on prompts. We're hoping this will simplify your usage of@inquirer/*packages.
- On windows, we will now use unicode characters whenever possible
- Performance improvements (less flickering mainly noticeable on select/checkbox)
- Errors thrown from prompts are now custom errors.
- Bugfix: When relying on asynchronous validation, the loader icon was broken.
- Chore: Added tests covering the prior issue to prevent future regression of loaders.
- All prompts are now themable. See each prompts documentation about the options available.
- BREAKING: The
messageoption of each prompt must now be astring. It could previously be an asynchronous function. See recipes for a migration option. - Node 18 required
- Fix: There was an issue with ESM/CJS imports interoperability that should now be fixed. Ref #1297
- Review how force exit events are handled to make sure we restore the cursor properly.
- Various dependencies bump (including TS 5.2.2)
- Breaking: Includes new major version of
@inquirer/core. - Bug fix: on Select & Checkbox prompt where it could happen the choice list wasn't matching the terminal width.
Fix bug where Common.js Typescript types definition were broken (should have no impact on ESM users)
- Performance improvements
- Includes updates in
@inquirer/core@2.2.0