select-prompt

0.3.2 • Public • Published

select-prompt

Deprecated. Use the select prompt from enquirer.


A prompt to an item from a list.

asciicast

npm version dependency status ISC-licensed chat on gitter

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.2
    636
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.2
    636

Package Sidebar

Install

npm i select-prompt

Weekly Downloads

809

Version

0.3.2

License

ISC

Unpacked Size

5.97 kB

Total Files

4

Last publish

Collaborators

  • derhuerst