@pfearr/sleep

1.0.2 • Public • Published

Sleep/Wait Module

How to setup and use Sleep/Wait Module

  1. Setup a NodeJS file and download the module
npm i @pfearr/sleep
  1. There are 2 ways to use the module effectively using await and .then()
const wait = require("@pfearr/sleep")
async function doStuff(){
    await wait(5000)
    console.log("Bruce, it's been 5 seconds and you still owe me 16 dollars.")
}

OR

const sleep = require("@pfearr/sleep")
sleep(2000).then(()=>{
    console.log("*yawn* That was a nice 2 second sleep.")
})

/@pfearr/sleep/

    Package Sidebar

    Install

    npm i @pfearr/sleep

    Weekly Downloads

    2

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    8.68 kB

    Total Files

    8

    Last publish

    Collaborators

    • pfearr