input.toggle
Prompts the user with a toggle 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.toggle({
key: 'toggle',
question: 'switch option',
enable: 'on',
disable: 'off'
});
console.log(result.toggle)