Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Normalize function arguments.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
CHANGELOG.md
LICENSE
README.md
package.json

README.md

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

Something went wrong with that request. Please try again.