News for hackers. Stuff that matters.
Re:How to write a command line application in Node.js by 10098 on Friday August 09, 2013 @07:16PM (#6189206)
There are tons of better options to choose from. If you're not making a web UI, literally any choice is better than Javascript, unless that is the only language you know.
Re:How to write a command line application in Node.js by bcoates on Friday August 09, 2013 @07:36PM (#6189287)
Compared to most languages you'd use for a commandline application, node has a simple, usable async I/O interface, and the libraries you can get for it actually assume async.

If you need that, there are only a handful of choices and node is one of them.

Re:How to write a command line application in Node.js by mhd on Friday August 09, 2013 @11:19PM (#6189951)
Which scripting language doesn't have an async library available (most of which don't descend into the Chinese Hell of Being Called Back Ad Infinitum)? Granted, most of the other languages have lots of libraries that don't play well with async, but then again, that's mostly because they have lots of libraries. And it's not like there's a guarantee that a random Node package won't screw you up, either.

I'm not really arguing against using JavaScript for command-line interfaces. I'd much rather see that than the same in PHP, and if the programmers don't know Perl, Python or Ruby, then why not? We're talking about an area where there are still way to many hacks that consist of badly written bash scripts with lots of inline sed and awk...

Re:How to write a command line application in Node.js by zeckalpha on Sunday August 11, 2013 @01:31AM (#6193969)
concurrency != async
Re:How to write a command line application in Node.js by aegiso on Friday August 09, 2013 @08:58PM (#6189593)
Brainfuck, then :).

People don't use node for the Javascript. They use it for the modules, and node is the glue that coheres them (and does an admirable job at that).

When you're comparing writing a CLI app in node to writing it in something else, it's a world of difference, and that difference is npm. With good modules, writing a CLI app has little to do with Javascript -- you're more specifying config and flow by passing some options and streams around, and you're done.

Re:How to write a command line application in Node.js by 10098 on Saturday August 10, 2013 @02:11AM (#6190232)
How about writing it in Perl and using CPAN instead of npm then? There are tons of modules in CPAN. But since Perl is not cool any more, there's always Python and pip.
Re:How to write a command line application in Node.js by kephra on Saturday August 10, 2013 @05:28AM (#6190533)
I have yet to see any language repository that constrains quality in the way CPAN does with CPAN testers.

CPAN modules must provide POD documentation, must provide a regression test, and must run on several dozen platforms before PAUSE accepts to publish it on CPAN.

Python or Ruby modules, or my favorite Lua, are a bunch of junk compared to CPAN.