named

simple wrapper for generating functions with named parameters

npm install named
1 downloads in the last week
7 downloads in the last month

named

A simple wrapper for generating functions with named parameters.

Usage

Create a named function by calling named on a function definition. The names of its arguments will determine the names of the parameters it will receive.

var named = require('named');

var pow = named(function (base, exponent) {
  return Math.pow(base, exponent);
});

Call the resulting function with a single object: a hash of parameter name to value.

pow({ base: 2, exponent: 3 }); // = 8

Tests

npm install --dev
npm test

License

Licensed under the MIT License. See the LICENSE file for the full text.

npm loves you