Now with Partition Management
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

sleep-ms

2.0.1 • Public • Published

sleep-ms

Sleep MS is primarily a command-line tool that emulates BASH SLEEP command using NodeJS.

Why sleep-ms?

First and foremost, it provides the ability to stall execution in milliseconds. SLEEP command supports seconds only (unless you install bash with loadable sleep). Secondly, a number of CI platforms do not support sleep within scripts, but if you are on NodeJS stack, you can easily utilise this module to overcome this limitation.

Installing sleep-ms

npm install sleep-ms --save;

Using CLI

# sleep for 1 second
sleepms 1000;

It is recommended that you do a global install using npm install sleep-ms -g;

Using the JS API

Usually there would not be any need to use this since using setTimeout in JavaScript is equivalent to this.

var sleepms = require('sleep-ms');
 
// sleep for one second
sleepms(1000);

Keywords

install

npm i sleep-ms

Downloadsweekly downloads

1,226

version

2.0.1

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability