Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
practical variable argument handling in node.js
JavaScript
branch: master

This branch is 3 commits ahead of cloudhead:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
LICENSE
README.md
index.js
package.json

README.md

vargs

Node.js module for variable argument handling for functions taking a callback.

synopsis

var Args = require('vargs');

function (/* [arg1, arg2, ...][,callback] */) {
    var args = new Args(arguments);

    args.first;         // first argument, if only callback given then return undefined
    args.last;          // last argument before callback
    args.callback;      // callback argument, or an empty function
    args.all;           // all arguments except callback
    args.length;        // number of arguments, not including callback

    args.hasCallback;   // true or false
    args.at(-1);        // last argument, including callback
    args.array;         // all arguments, including callback
}
Something went wrong with that request. Please try again.