Skip to content

samirkumardas/ask-questions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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);
});

alt text

About

A small utility function for asking multiple CLI questions based on node readline module

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published