1.0.4 • Published 8 years ago

currying.js v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

Reduce code nesting by currying

var fs = require('fs')
var currying = require('currying.js');
/*
the f , which is the last arguments of the functions
refers to the next function
*/ 

var f1 = (f)=>{
    fs.readFile('package.json',f)
};

var f2 = (err,data,f)=>{
    console.log(data.toString());
    fs.readFile('package.json',f);
};

var f3 = (err,data)=>{
    console.log(data.toString());
}

currying(f1,f2,f3)();
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago