Inquirer strives to be an easily embeddable and beautiful command line interface for Node.js

You can access these tools on the @weex-cli/core, via const { inquirer } = require('@weex-cli/core').

This is powered by Inquirer.js.

It should ease the process of:

  • providing error feedback
  • asking questions
  • parsing input
  • validating answers
  • managing hierarchical prompts

This is an async function.

prompt

context.inquirer.prompt(questions) -> promise

Launch the prompt interface (inquiry session)

registerPrompt

context.inquirer.registerPrompt(name, prompt)

Register prompt plugins under name.

  • name (string) name of the this new prompt. (used for question type)
  • prompt (object) the prompt object itself (the plugin)

createPromptModule

context.inquirer.createPromptModule() -> prompt function

Create a self contained inquirer module. If you don't want to affect other libraries that also rely on inquirer when you overwrite or add new prompt types.

let prompt = context.inquirer.createPromptModule();
 
prompt(questions).then(/* ... */);

More detail you can see Inquirer.js.