1.1.0 • Published 6 years ago

rnode v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

rnode

Make node become really random, useful when checking you have no race conditions.

This adds a random delay to the async fuctions in node's modules:

  • fs
  • dns
  • child_process (exec and execFile only)

This random delay makes it much easier to spot if you are relying on timing of these async functions that might be working 90% of the time. A random delay can make it fail more like 1 in 2 times.

Build Status Dependency Status NPM version

Installation

npm install rnode

Usage

The API is simply rnode(min, max), e.g.

const rnode = require('rnode');
rnode('100 ms', '1 second');

You can pass either a string, as understood by the ms libarary, or a number of milliseconds. The defaults are 0 and 500ms.

License

MIT

1.1.0

6 years ago

1.0.0

7 years ago

0.0.2

10 years ago

0.0.1

10 years ago