input.confirm
Prompts the user with a confirmation question.
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
option | Object | Contains the key and question for the prompt. Properties
|
Returns:
The user's response.
- Type:
- Promise.<Object>
Example
import { input } from "@jlongyam/cli";
let result = await input.confirm({
key: 'ok',
question: 'are you agree with this'
});
if(result.ok) {
console.log('good choise')
} else {
console.log('too bad')
}