Joined July 2011
·
vvo

Vincent Voyer

Fasterize
·
Paris, france
·
·
·

Posted to Simple Node.js prompt over 1 year ago

@turg0n Hey hi. I tried commander.js before diving into node's readline functions.

It turned out commander.js was buggy. When prompting, ̀return ̀ would not trigger end of prompt, needed to press ̀return ̀ twice.

All I needed was a simple prompt function. Did not want to debug a library that seemed not so up to date based on new node readline library. So made my simple function and voilà!

Now thinking to build my own simple node-input library that would prompt/confirm/choose only. No option parsing etc as commander.js do. There are already a lot of modules for that.

What do you think?

Maybe you could link to an actual http://jsperf.com/ link.

And maybe you'll see that the performance gain is worth only when you are doing billions of jQuery selects in a for loop.

So, if you're not doing it in a for loop then your wasting your time trying optimizing something that only happens once.

Achievements
376 Karma
35,481 Total ProTip Views