0.1.1 • Published 7 years ago

range-prompt v0.1.1

Weekly downloads
7
License
ISC
Repository
github
Last release
7 years ago

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.