Node.js is the best environment for running non-browser JS. I used Rhino and SpiderMonkey, and there is a huge difference in everything, starting with the basics, for example, how errors are handled with community size using this tool. Node is broken down into server-side JS server-side applications in JS. This is great for that. But it works equally well for creating command line tools.
The NPM package manager (bundled with Node) provides a good global directory for finding and installing packages. It works much better than other language equivalents like PECL / Pear / CPAN / etc. Several high-quality tools, such as JSHint , the Jade template language, and the CoffeeScript compiler are already available through NPM / Node:
npm install -g jshint, coffee-script, jade jshint my_code.js jade < my.jade > my.html
There are packages such as commander.js for args analysis. I am currently using a highly enhanced version of Commander in my underscore-cli command line tool.
For messaging with JSON or for doing JS command line work (similar to "perl -pe"), underscore-cli - This is a really powerful tool for processing JSON data, processing underscore patterns, and running JS expressions from the command line. I use it for 1001 different things that otherwise would be really unpleasant to achieve.
Dave dopson
source share