Skip to content
/ psleep Public

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

License

Notifications You must be signed in to change notification settings

SEAPUNK/psleep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!')
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published