0.1.0 • Published 10 years ago

assert-cb v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

assert-cb build status

Assert that calls a function with an error instead of throwing it if the assert fails.

var assert = require('assert-cb')

function doStuff(opts, cb) {
 if (!assert(opts.day, 'need to provide day', cb)) return;
 if (!assert(opts.hour, 'need to provide hour', cb)) return;
 
 // determine result
 [..]
 cb(null, res);
}

Installation

npm install assert-cb

generated with docme

License

MIT