On Nov 21, 2013, at 8:23 PM, Victor Hooi <
victo...@gmail.com> wrote:
>
> I'm curious on people's experiences with using Node.JS for sys-admin scripts or non-Web glue stuff - i.e. the sorts of things you might use Perl or Python for (e.g. log parsing, manipulating config files etc.)
>
> Is Node.JS suitable for these things?
>
Sure, JavaScript is a capable and feature-rich *high-level* language. NodeJS provides decent access to OS facilities, and NPM is a reliable source of additional functionality (even if it is no CPAN, or not yet CPAN). But I’d say, stepping strictly into personal opinion or preference territory, JavaScript (or Python for that matter) will never be as comfortable for sys-admin tasks as Perl. If having to carry the cognitive load of thorough-going async for inherently synchronous activities does not tax you, then the lack of Perl’s terse and intuitive (for a Unix-head) syntax for things like file test (-f, -l, etc), pipes (“|”), regular expressions, program execution (``), etc, might. Even if they do, it might be a small price to pay *if* the rest of your code is JavaScript/NodeJS.
> Are there any books or guides out there on these sorts of things? (Most of the books I've seen are geared to Node.JS purely as a web app language).
>
> Or any detailed examples people have posted up of what they use it for?
Sorry, I do not know of any.
—ravi