Socket
Book a DemoInstallSign in
Socket

rnode

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rnode

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

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 08 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts