pwait

1.0.1 • Public • Published

Install

npm i --save pwait

Usage

async/await:

const wait = require('pwait');
async function doSomething() {
    //...
    await wait(1000); //wait 1000ms and do nothing
    //...
}

Promise:

const wait = require('pwait');
wait(1000).then(()=>{
    console.log('after 1s');
}).then(()=>wait(1000)).then(()=>{
    console.log('another 1s');
});

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i pwait

      Weekly Downloads

      0

      Version

      1.0.1

      License

      MIT

      Last publish

      Collaborators

      • longbill