Hubro
Hubro

Reputation: 59333

Is there a module for getting user input from the command line in node.js?

First of all: I don't mean parsing arguments and options from the process.argv array, but prompting the user and handling input/output. I've looked through the Node.js official module list without finding any sections or subsections that mentions input. In fact a search for 'input' on that page only gets 1 result which has something to do with YAML.

Anyway, I suppose cli input should be asynchronous and I've solved this issue before using stdin.on('data') which was messy to say the least. This seems like a perfect task for a node module which could come with extra goodies such as progress bars, spinners, coloured output, input validation etc.

There probably are some modules out there that does this, but I can't find any of them.

Help!!

(To clarify, the only functionality I require is the simplification of handling user input)

Upvotes: 7

Views: 1332

Answers (1)

Related Questions