0.1.2 • Published 4 years ago

@jib/prompt v0.1.2

Weekly downloads
9
License
MIT
Repository
-
Last release
4 years ago

Jib Prompt Plugin

Plugin for @jib/cli to support the extensible prompt framework, inquirer.

wercker status

About

This project was generated using the jib command line generator.

Usage

npm install --save @jib/prompt

Using within @jib/cli commands:

import { Command, Plugin } from '@jib/cli';
import { JibPrompt } from '@jib/prompt';

@Command({/* */})
class MyCustomCommand {
  // inject plugin
  @Plugin(JibPrompt)
  public helper: JibPrompt;

  public async run(options: any, ...args: string[]) {
    this.helper.prompt({
      // ...
    })
  }
}

Provide a custom adapter when prompts should be handled differently (like unit tests)

JibPrompt.adapter({
  prompt: (questions: any) => Promise.resolve({}),
});