range-prompt

0.1.1 • Public • Published

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.

Package Sidebar

Install

npm i range-prompt

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • derhuerst