call-back
v1.0.1
Published
node style callback uitl.
Downloads
9
Readme
call-back
node style callback util.
Why?!
Most of the CLI app I have made with node have a common pattern:
output(data, function(err, result) {
if (!err) {
console.log(result)
} else {
throw new Error(err);
}
});
Wanted to reduce it:
output(data, cb);
Install
$ npm install --save call-back
Usage
var cb = require('call-back');
output(data, cb);
// ^ where output is a module that as node-style callback.
License
MIT © Hemanth.HM