cloudcmd/modules/currify
2016-12-28 17:42:23 +02:00
..
dist feature(bower) currify v2.0.3 2016-12-05 17:10:01 +02:00
lib feature(bower) currify v2.0.2 2016-11-24 11:26:29 +02:00
.bower.json feature(util) Util.type -> itype 2016-12-28 17:42:23 +02:00
bower.json feature(bower) currify v2.0.2 2016-11-24 11:26:29 +02:00
ChangeLog feature(bower) currify v2.0.3 2016-12-05 17:10:01 +02:00
LICENSE feature(bower) currify v2.0.2 2016-11-24 11:26:29 +02:00
package.json feature(bower) currify v2.0.3 2016-12-05 17:10:01 +02:00
README.md feature(bower) currify v2.0.2 2016-11-24 11:26:29 +02:00

Currify License NPM version Dependency Status Build Status

Translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments.

Install

npm i currify --save

How to use?

const currify = require('currify');

const mean = (a, b, c) => (a + b) / c;
const mean1 = currify(mean, 1);
const mean2 = mean1(2);

mean2(2);
// returns
1.5

Environments

In old node.js environments that not fully supports es2015, currify could be used with:

var currify = require('currify/legacy');
  • zames - converts callback-based functions to Promises and apply currying to arguments

License

MIT