This package has been deprecated

Author message:

Development of this module has been stopped.

pause-promise

1.0.6 • Public • Published

pause

Greenkeeper badge NPM version Build status License Code style

Simple promise wrapper around setImmediate, setTimeout.

Why?

Useful when needing to suspend generator or async functions without doing anything.

const pause = require('pause-promise')
 
async test () {
  const elements = await getSomeArray()
 
  for (const element of elements) {
    // do stuff
 
    // hold off for 50 ms until next iteration
    await pause(50)
  }
}
 
test()

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i pause-promise

    Weekly Downloads

    1

    Version

    1.0.6

    License

    MIT

    Last publish

    Collaborators

    • roryrjb