0.1.0 • Published 9 years ago

checkerr v0.1.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
9 years ago

Checkerr

Check for callback errors and handle them in one line

Exit process on error

var check = require('checkerr').andExitProcess;

doSomething(function(err, result)) {
	check(err);
	doActualStuff(result);
});

Call a higher callback on error

var check = require('checkerr').andCallHigherCallback;

function mainFunction(topmostCallback) {

	doSomething(function(err, result)) {
		if(check(err, topmostCallback)) return;

		doActualStuff(result);
	});

});

To mock out, with mockery e.g.

mockery.registerSubstitute('checkerr', 'checkerr/mock-disable');
0.1.0

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago