input.toggle

Prompts the user with a toggle question.

Parameters:
NameTypeDescription
optionObject

Contains the key and question for the prompt.

Properties
NameTypeDescription
keystring

The key for the response.

questionstring

The message to display to the user.

enablestring

Placeholder for boolean true.

disablestring

Placeholder for boolean false.

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)