@ts4/sleep
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

@ts4/sleep

@ts4/sleep advanced typescript sleep function with async/await

Installation

npm install @ts4/sleep

Usage

import sleep from '@ts4/sleep';
// or
import { sleep } from '@ts4/sleep';
// or
const sleep = require('@ts4/sleep');

(async () => {
    await sleep(1000); // sleep 1 sec
    await sleep([1000, 2000, 3000]); // random sleep 1 or 2 or 3 sec
    await sleep(1000, 2000); // random sleep between 1(inclusive) and 2(inclusive) sec
})();

Readme

Keywords

none

Package Sidebar

Install

npm i @ts4/sleep

Weekly Downloads

1

Version

1.0.7

License

none

Unpacked Size

3.31 kB

Total Files

5

Last publish

Collaborators

  • ilya7u