2.0.0 • Published 7 years ago

psleep v2.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

psleep

DEAR GOD DON'T USE THIS USE delay WITH ms INSTEAD

Resolve a promise after some time. Good for async/await.

basically the delay module with the ms module built in

Uses the ms module for millisecond conversion, if supplied argument is a string.

import psleep from 'psleep'

async function doThings () {
  console.log('hello...')
  await psleep('10 seconds') // waits 10 seconds
  await psleep(2000) // waits 2 seconds
  console.log('world!')
}
2.0.0

7 years ago

1.0.0

8 years ago