nargs

Normalize function arguments.

npm install nargs
3 downloads in the last week
10 downloads in the last month

Node.js - nargs

Normalize function arguments.

Why?

So you can easily do things like:

function doSomething() {
    var args = nargs(arguments);
    console.log(args[0]);
    console.log(args[1]);
}

doSomething('a', 'b'); // 'a', 'b'
doSomething(['a', 'b']); //'a', 'b'

Installation

npm install nargs

Example

See the test suite for more examples and expected output.

Author

node-nargs was written by JP Richardson. You should follow him on Twitter @jprichardson. Also read his coding blog Procbits. If you write software with others, you should checkout Gitpilot to make collaboration with Git simple.

License

(MIT License)

Copyright 2012, JP Richardson jprichardson@gmail.com

npm loves you