Asking
Tiny utility library for getting user input in CLI programs. Based on prompt and inspired by Ruby's highline gem.
Installation
npm install asking --save
and in your script:
var choose = require('asking').choose;
var ask = require('asking').ask;
Examples
ask
ask ('Enter your email: ', function (err, email) {
});
ask ('Enter your password: ', { hidden: true }, function (err, password) {
});
ask ('Enter a color: ', { pattern: /red|green|blue/ }, function (err, color) {
});
ask ('Enter your name: ', { default: 'John Doe' }, function (err, name) {
});
choose
choose ('Select a color', ['red', 'green', 'blue'], function (err, color) {
});
choose ('Choose your position', {
junior: 'Junior Developer',
senior: 'Senior Developer',
master: 'Kick-ass Developer'
}, function (err, answer, position) {
});
License
Asking is released under the MIT License.