How to write a command line application in Node.js
blog.liangzan.net
How to write a command line application in Node.js
1–10 of 56 posts
Re: How to write a command line application in Node.js
#2Re: How to write a command line application in Node.js
#3Is there a reason to build a command line application in Node.js? It doesn't really seem like Node is the right tool for the job...
If you want to write in C for performance reasons, go ahead. But if your other alternatives are Python or Ruby and you already know JS, give node a go -- it's pretty fun.
Re: How to write a command line application in Node.js
#4Is there a reason to build a command line application in Node.js? It doesn't really seem like Node is the right tool for the job...
Node is best used managing parallel streams of stuff. Perhaps surprisingly, a command line application is a great example of that.
I would much rather build a nontrivial command line app in node than in anything else. Try it, you'll see.
Re: How to write a command line application in Node.js
#5Is there a reason to build a command line application in Node.js? It doesn't really seem like Node is the right tool for the job...
If a person already knows JavaScript well, then it will be easier for them to write a CLI app/utility/script in JS than it would be to write a shell script.
Another reason to write in JS would be to gain code reuse. If the person has a web app that uses node, then they can share code between the web and CLI applications.
Re: How to write a command line application in Node.js
#6Is there a reason to build a command line application in Node.js? It doesn't really seem like Node is the right tool for the job...
If you're doing crazy heavy processing or something, it's not the right tool. But you wouldn't do that in JS. You'd shell out or call something native. Node is best used managing parallel streams of stuff. Perhaps surprisingly, a command line application is a great example of that. I would much rather build a nontrivial command line app in node than in anything else. Try it, you'll see.
Re: How to write a command line application in Node.js
#7Re: How to write a command line application in Node.js
#8You 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.
But take it with a grain of salt: it's very much a use-what-you-know kind of thing.