chaotic-cb

0.0.2 • Public • Published

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

/chaotic-cb/

    Package Sidebar

    Install

    npm i chaotic-cb

    Weekly Downloads

    0

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • dweinstein