nargs

0.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i nargs

Weekly Downloads

2

Version

0.0.2

License

none

Last publish

Collaborators

  • jprichardson