1.0.1 • Published 9 years ago

call-back v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

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

1.0.1

9 years ago

1.0.0

9 years ago