Skip to content

Releases: SBoudrias/Inquirer.js

[email protected]

16 Nov 22:29
[email protected]
676685d

Choose a tag to compare

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.

@inquirer/[email protected]

16 Nov 22:29
@inquirer/[email protected]
676685d

Choose a tag to compare

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.

[email protected]

12 Nov 21:43
[email protected]
4731a37

Choose a tag to compare

  • [Node 18 compat] Downgraded to mute-stream@2 to maintain Node 18 compatibility.
  • [Typescript] Allow passing a Partial<{ ... }> type as pre-filled answers.

@inquirer/[email protected]

12 Nov 21:42
@inquirer/[email protected]
4731a37

Choose a tag to compare

  • [Node 18 compat] Downgraded to mute-stream@2 to maintain Node 18 compatibility.

[email protected]

08 Nov 19:47
[email protected]
6881993

Choose a tag to compare

  • feat @inquirer/input: Now support simple RegExp validation with pattern/patternError.
  • fix @inquirer/editor: Fix typo s/waitForUseInput/waitForUserInput
  • Bump dependencies

@inquirer/[email protected]

08 Nov 19:47
@inquirer/[email protected]
6881993

Choose a tag to compare

  • feat @inquirer/input: Now support simple RegExp validation with pattern/patternError.
  • fix @inquirer/editor: Fix typo s/waitForUseInput/waitForUserInput
  • Bump dependencies

@inquirer/[email protected]

08 Nov 19:48
@inquirer/[email protected]
6881993

Choose a tag to compare

  • feat @inquirer/input: Now support simple RegExp validation with pattern/patternError.
  • Bump dependencies

@inquirer/[email protected]

08 Nov 19:48
@inquirer/[email protected]
6881993

Choose a tag to compare

  • fix @inquirer/editor: Fix typo s/waitForUseInput/waitForUserInput
  • Bump dependencies

[email protected]

13 Oct 21:29

Choose a tag to compare

  • 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

@inquirer/[email protected]

13 Oct 21:28

Choose a tag to compare

  • 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