@inquirer/number

Interactive number input prompt for Node.js CLI applications.

npmmacoslinuxwindows
Try with needOr install directly
Source

About

Inquirer number prompt

Examples

prompt user to enter a number in terminal$ const { createPrompt } = require('@inquirer/number'); const answer = await createPrompt({ message: 'Enter a number' });
ask for number with minimum and maximum value validation$ const answer = await createPrompt({ message: 'Pick a number between 1-100', min: 1, max: 100 });
get numeric input with default value pre-filled$ const answer = await createPrompt({ message: 'Enter quantity', default: 5 });
collect age from user with validation$ const answer = await createPrompt({ message: 'What is your age?', min: 0, max: 150, validate: (val) => val > 18 });
build interactive CLI form asking for multiple numbers$ const width = await createPrompt({ message: 'Width in pixels' }); const height = await createPrompt({ message: 'Height in pixels' });