node.js callback tools
Tools for simplifying node.js callback style programming.
errh(func, cb)
Returns function(err, result) that calls cb(err) if err != null and else calls func(result, cb).
Simplifies this case:
{ ;};
to this one:
var errh = errh; {
errh.noResult(cb)
Returns function(err) that calls cb(err) shrinking any other arguments.
Useful for getting rid of insert or update results when querying db.
errh.nullResult(cb)
Like errh.noResult(cb), but calls cb(err, null).
License
MIT