0.1.0 • Published 9 years ago
switch-prompt v0.1.0
switch-prompt
A CLI prompt with an iOS-style on/off switch.
switch-prompt uses cli-styles and prompt-skeleton to have a look & feel consistent with other prompts.
Installing
npm install switch-promptUsage
switchPrompt(question, [activeText], [inactiveText], [defaultValue])const switchPrompt = require('switch-prompt')
switchPrompt('Send anonymous usage data?', 'yes', 'no', true)
.on('data', (e) => console.log('Interim value', e.value))
.on('submit', (v) => console.log('Submitted with', v))
.on('abort', (v) => console.log('Aborted with', v))Related
text-promptdate-promptmail-promptmultiselect-promptnumber-promptrange-promptselect-prompttree-select-promptcli-autocomplete
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.
0.1.0
9 years ago
