sleep-await
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

sleep-await

It is used when you want to execute the next logic after a specific millisecond using sleep.

This function must use async await. Execution is paused through the awiat keyword, and execution resumes when the promise is processed.

https://www.npmjs.com/package/sleep-await

⚙️ Installation

Npm

$ npm install sleep-await

🏃 Quick Start

Example

import { sleepAwait } from "sleep-await";

TESTA();
async function TESTA() {
  console.log("11"); // "11"

  await sleepAwait(3000); // -> after 3 seconds

  console.log("22"); // -> "22"

  return true;
}

/sleep-await/

    Package Sidebar

    Install

    npm i sleep-await

    Weekly Downloads

    226

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    8.55 kB

    Total Files

    6

    Last publish

    Collaborators

    • joker0713