select-prompt
v0.3.2
Published
A prompt to select zero or more items.
Downloads
1,183
Maintainers
Readme
select-prompt
Deprecated. Use the select prompt from enquirer
.
A prompt to an item from a list.
select-prompt uses cli-styles and prompt-skeleton to have a look & feel consistent with other prompts.
Installing
npm install select-prompt
Usage
const prompt = require('select-prompt')
const colors = [
{title: 'red', value: '#f00'},
{title: 'yellow', value: '#ff0'},
{title: 'green', value: '#0f0'},
{title: 'blue', value: '#00f'},
{title: 'black', value: '#000'},
{title: 'white', value: '#fff'}
]
prompt('What is your favorite color?', colors, {cursor: 3})
.on('data', (e) => console.log('Interim value', e.value))
.on('abort', (v) => console.log('Aborted with', v))
.on('submit', (v) => console.log('Submitted 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.