Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

derhuerst/switch-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

switch-prompt

Deprecated. Use the confirm prompt or select prompt from enquirer.


A CLI prompt with an iOS-style on/off switch.

asciicast

npm version dependency status ISC-licensed chat on gitter

switch-prompt uses cli-styles and prompt-skeleton to have a look & feel consistent with other prompts.

Installing

npm install switch-prompt

Usage

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

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

About

A CLI prompt with an iOS-style on/off switch.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published