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

0.0.1 • Public • Published

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>;

Readme

Keywords

Package Sidebar

Install

npm i @jellybeanci/sleep

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

2.91 kB

Total Files

5

Last publish

Collaborators

  • jellybeanci