Skip to content

derhuerst/range-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

range-prompt

A prompt to select a value in a range.

asciicast

npm version dependency status dev dependency status ISC-licensed chat on gitter

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

Installing

npm install range-prompt

Usage

const rangePrompt = require('range-prompt')

rangePrompt('How much ice cream would you like?', {
	min: 0, max: 10, value: 2, step: .1, unit: 'kg'
})
.on('data', (item) => console.log('Changed to', item, 'kg'))
.on('abort', (item) => console.log('You aborted, having chosen', item, 'kg'))
.on('submit', (item) => console.log('You chose', item, 'kg'))

Related

Contributing

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