0.0.2 • Published 9 years ago
chaotic-cb v0.0.2
SYNOPSIS
Return a callback that errors randomly with a particular ratio.
USAGE
var chaos = require('chaotic-cb')(0.9);
var cb = chaos(function(err, res) { console.log(err?err:res); });
cb(null, "testing...");
var cb = chaos(0.9, function(err, res) { console.log(err?err:res); });
cb(null, "I probably won't happen...");
See the example