rnode

1.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i rnode

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

5.02 kB

Total Files

6

Last publish

Collaborators

  • forbeslindesay