ask-all-questions
v0.1.3
Published
Read one or more lines in Node.JS
Downloads
2
Maintainers
Readme
ask-all-questions
Simple Node.JS module to show and read many questions on command line applications.
Installation
Run the command:
npm i ask-all-questions
Example:
var askAllQuestions = require('ask-all-questions');
askAllQuestions([
{ name: 'user', question: 'user: ' },
{ name: 'password', question: 'password: ' },
{ name: 'applicationName', question: 'application name: ' },
{ name: 'applicationPath', question: 'application path: ' }
], function (prompts) {
console.dir(prompts);
});
Or with promise:
var askAllQuestions = require('ask-all-questions');
askAllQuestions([
{ name: 'user', question: 'user: ' },
{ name: 'password', question: 'password: ' },
{ name: 'applicationName', question: 'application name: ' },
{ name: 'applicationPath', question: 'application path: ' }
]).then(function (prompts) {
console.dir(prompts);
});
This shows these questions:
user: myUserName
password: myPassword
application name: myApp
application path: c:\projects\myProject
and print:
{ user: 'myUserName',
password: 'myPassword',
applicationName: 'myApp',
applicationPath: 'c:\\projects\\myProject' }