Skip to content

Latest commit

 

History

History
57 lines (32 loc) · 976 Bytes

README.md

File metadata and controls

57 lines (32 loc) · 976 Bytes

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