npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

call-back

1.0.1

@hemanth

npmHomeRepoSnykSocket
Downloads:11
$ npm install call-back
DailyWeeklyMonthlyYearly

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