Nodejs is not great for stdin processing. Were I ever to do any real commandline processing. I don't often need to process user input, but if I were, I would never use this code and would use commander.