⁉️ confirmation
A simple Node tool to have Browser's confirm
popup on your CLI.
Installation
yarn add confirmation
Usage
In an async
function just call await confirmation
.
if await console; else console;
API
await confirmation(message) : bool
Shows a message and OK
and Cancel
buttons.
Example:
const result = await
await confirmation(title, message) : bool
Shows a message with a title and OK
and Cancel
buttons.
Example:
const result = await
await confirmation(title, message, ok, cancel) : bool
Shows a message with a title and custom OK
and custom Cancel
buttons.
Example:
const result = await
The Key bindings
The Y for OK and N for Cancel are the default key bindings.
When you customize your OK and Cancel buttons, the first letter will be the key binding. If you make I am Sure instead of OK, you'll need to press I to confirm.
Example 1
Example:
const result = await
Keymap:
- O to Confirm
- X to Close
Example 2
Example:
const result = await
Keymap:
- A (_A_ye) to Confirm
- N (_N_o) to Close
License
MIT © Fatih Kadir Akin