@lvchengbin/sleep

0.0.2 • Public • Published

Sleep

A sleep function for javascript.

Start

$ npm i @lvchengbin/sleep --save

To use it in nodejs:

const sleep = reuqire( '@lvchengbin/sleep' );

Or to import it as an ES6 module:

import sleep = require( '@lvchengbin/sleep' );

Usage

async () => {
    await sleep( 1000 ); // sleep for 1 second
}

sleep( 1000 ).then( () => {
    // execute after 1 second
} );

Package Sidebar

Install

npm i @lvchengbin/sleep

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

26.6 kB

Total Files

11

Last publish

Collaborators

  • lvchengbin