Skip to content

Upgrading inquirer 0.12 to 1

Breaking0.12.0 → 1.2.3Breaking5New1Changed1Fixed9Other1

BreakingUpgrade verdict

5 breaking changes.

  • You can no longer pass a callback to inquirer.prompt.
  • The library now uses promises instead of callbacks for all its operations.
  • You now get results by chaining .then() on the prompt call instead of passing a callback.
  • Custom question functions should return a promise rather than calling this.async().
Top 3 of 5 that need code or config changes

Adds external-editor ^1.1.0, mute-stream 0.0.6, pinkie-promise ^2.0.0, rx ^4.1.0.

Drops ansi-regex, readline2, rx-lite.

Installs 43 packages in all (was 27).

Also installs buffer-from, concat-stream, core-util-is, extend, inherits, isarray, os-shim, os-tmpdir, pinkie, process-nextick-args, readable-stream, safe-buffer, spawn-sync, string_decoder, tmp and 2 more.

No longer installs once, wrappy.

Moves mute-stream 0.0.5 → 0.0.6, run-async 0.1.0 → 2.4.1. Your build may pick other versions.

Breaking5
inquirer.prompt no longer takes a callback argument.
inquirer.prompt
The whole inquirer API is now based on promises.
The base API interface is now inquirer.prompt(questions).then(); there is no more callback function.
inquirer.prompt
Async question functions now return a promise instead of requiring this.async().
this.async()
filter is now always run before validate.
filtervalidate