Skip to content

jellybeanci/sleep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sleep

Promise based async sleep function.

npm i @jellybeanci/sleep

import module

// ES6 Syntax
import {sleep, delay} from "@jellybeanci/sleep";

// Commonjs Syntax
const {sleep, delay} = require("@jellybeanci/sleep");

usage

console.log("See you after 5 sec");
await sleep(5000);
console.log("5 sec passed");
console.log("See you after 5 sec");
await delay(5);
console.log("5 sec passed");

types

type sleep = (millisecond: number) => Promise<unknown>;

type delay = (second: number) => Promise<unknow>;

About

Promise based async sleep module.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published