An open API service indexing awesome lists of open source software.

https://github.com/dweinstein/node-chaotic-cb

return a callback that introduces errors with a certain ratio
https://github.com/dweinstein/node-chaotic-cb

Last synced: 4 months ago
JSON representation

return a callback that introduces errors with a certain ratio

Awesome Lists containing this project

README

          

# SYNOPSIS

Return a callback that errors randomly with a particular ratio.

# USAGE

```javascript
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](example.js)