node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org ยป



node-cli is a small node module. I build it in order to easily handle node command line arguments.


install node-cli by using npm.

npm install node-cli

or with option -g (global) in order to make it available globally

npm install node-cli -g

load the module within your node script by using require.

var cli = require("node-cli");


The entire node-cli configuration is handeld by the init([optionl]args, [optional]delimiter) method. By default, node's system arguments are passed to node-cli (process.argv). The default delimiter is '='.


  • hasArguments(includeSystemArguments)
  • containsArgument(argument)
  • getArguments()
  • getArgumentAt(index)
  • getArgumentValueAt(index)
  • getArgument(key)
  • getArgumentAt(key)
  • getCount()
  • require(requiredArguments, onSuccess, onError)


.... read my post at


node-cli has been written using TDD, in order to execute the tests, you need to install mocha. You can easily install mocha by using npm. npm install mocha

By using mocha -R spec tests/* you can run all existing tests.