1.0.0 • Published 6 years ago
ask-questions v1.0.0
Ask Questions
Using the method question of Node for multiple questions is a pain. You have to go through the irritating callback hell although you have few simple questions to ask and want to avoid using a heavy library.
It is a small utility node module for asking multiple command line questions on top of nodejs readline module that returns a promise and resolve with answwers when all questions have been asked.
Install
npm install --save-dev ask-questions
How to use?
const askQuestions = require('ask-questions');
let questionnaire = {
name: 'Enter Your Name:',
email: 'Enter Your Email: ',
direction: 'Enter Output Directory Name: (dist) '
};
askQuestions(questionnaire).then((answers)=> {
console.log(answers);
});
1.0.0
6 years ago