Name Last Update
..
.editorconfig Loading commit data...
.jshintrc Loading commit data...
.npmignore Loading commit data...
.travis.yml Loading commit data...
0.js Loading commit data...
1.js Loading commit data...
2.js Loading commit data...
3.js Loading commit data...
4.js Loading commit data...
5.js Loading commit data...
LICENSE Loading commit data...
N.js Loading commit data...
README.md Loading commit data...
package.json Loading commit data...
test.js Loading commit data...

arity-n

Build Status npm version

Wraps a function with a function of a sertain arity.

Installation

npm install arity-n

Usage

function fn(a, b, c, d) {
}

var arityN = require('arity-n');
var newFn = arityN(fn, 3);

newFn.length; // => 3

var arity4 = require('arity-n/4');
var newFn = arity4(fn);

newFn.length; // => 4

// Max arity is 5.
var newFn = arityN(fn, 7);

newFn.length; // => 4