The number one reason to write CLI apps in node is npm. npm gets package management right, preferring local dependencies to global ones - this means no worrying about what version of a library a user has in their global environment.<p>You also get to bring node's parallel io-centric patterns to your scripting. Need to download a bunch of files from a remote host, process them, and write them to disk? Go for it.<p>But take it with a grain of salt: it's very much a use-what-you-know kind of thing.
Definitely check out Inquirer.js if you're using prompts in a Node CLI application. It's the prompt utility used by Yeoman generators:<p><a href="https://github.com/SBoudrias/Inquirer.js" rel="nofollow">https://github.com/SBoudrias/Inquirer.js</a>
Callbacks and CLI apps aren't a good fit in my opinion. I do like writing command line tools using Common Node though: <a href="https://github.com/olegp/common-node" rel="nofollow">https://github.com/olegp/common-node</a>
Something similar but published just last week: <a href="http://flippinawesome.org/2013/07/29/writing-a-command-line-utility-using-node/" rel="nofollow">http://flippinawesome.org/2013/07/29/writing-a-command-line-...</a>
I find the lack of a synchronous way to pass a command to the shell and get the result makes node much more difficult for the kinds of things I usual write in ruby.
in this day and age, if i had to create a command line app, from zero, i would definetly start with go.. it has all the functionality in standard libs and the package manager can handle github repos for third-parties (like mongo or mysql drivers).. you just compile it and go!<p>can be as simple than that? the right tool for the job..<p>if i would create a library that everyone could use and embed i would use C for that..<p>if i would like to build a VM, a compiler, a browser or a OS i would use c++ (is almost c, fast and gives you easy composability and control)<p>i would use javascript.. but only in the browser and because and dont have nowhere to go or to runaway for.. (no transpiling either please)<p>this is just the general experience of my years of coding and deling with every lang in the earth.. rsrs<p>ruby is pretty, eyecandy, bu is like a virgen that cant be touched.. python looks just like perl.. is a complete mess, and is like the mafia,i prefer not to touch or to have any involvement with them.. java is the frankenstein child of c++.. you can create big software with it.. but to many keywords and excessive use of vtables..<p>and for ui and web, network, etc.. i would use something like dart for this job, any day.. the code can grow and you can still understand your code<p>so these days i would use c, c++, go or dart.. in the case i can choose of course.. :)