mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
1.6 KiB
1.6 KiB
Currify

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');
Related
- zames - converts callback-based functions to Promises and apply currying to arguments
License
MIT