A library for extensions of classic node callback functions
Install it for use in node.js:
npm install --save -E camda
var CB = require('camda').CB;
var request = require('request');
// Creating a simple CB for a http GET request
var get = CB(request);
// mapping over the response
var getStatusCode = get.map(res => res.statusCode);
// execute normally!
getStatusCode('https://github.com/', (err, code) => {
if(err) return console.error(err);
console.log('Status code returned: ' + code);
});
MIT https://github.com/JeffDownie/camda/raw/master/LICENSE.txt