https://github.com/substack/node-optimist
Optimist is a node.js library for option parsing for people who hate option parsing. More specifically, this module is for people who like all the --bells and -whistlz of program usage but think optstrings are a waste of time.
var argv = require('optimist').argv;
if (argv.rif - 5 * argv.xup > 7.138) {
console.log('Buy more riffiwobbles');
}
else {
console.log('Sell the xupptumblers');
}
rif and xup are two arguments.
It's a quick-and-dirty way to access command line arguments without defining them in your code before actually using them. The second part of the example (which you omitted in your question) actually answers your first question:
$ ./xup.js --rif=55 --xup=9.52
Buy more riffiwobbles
$ ./xup.js --rif 12 --xup 8.1
Sell the xupptumblers
So those arguments end up in argv.rif and argv.xup.