Reputation: 59333
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
Reputation: 1337
Search for modules here: http://eirikb.github.com/nipster/
Also, if you want to write your own: http://nodejs.org/docs/latest/api/all.html#readline
#node.js
IRC welcomes you: http://webchat.freenode.net/?channels=node.js
Upvotes: 12