@jib/prompt
v0.1.2
Published
inquirer Plugin for @jib/cli
Downloads
3
Readme
Jib Prompt Plugin
Plugin for @jib/cli
to support the extensible prompt framework,
inquirer
.
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({}),
});