sleep.async

1.0.4 • Public • Published

sleep.async

Super simple promisify sleep module.

Install

npm i sleep.async --save

sleep(delay)

const sleep = require('sleep.async')
sleep(2000).then(() => {
  console.log('2000ms later.')
})

with asyncawait

npm install asyncawait --save
const async = require('asyncawait/async'),
      await = require('asyncawait/await'),
      sleep = require('sleep.async')

const delay = async (() => {
  await (sleep(2000))
  console.log('2000ms later.')
})
delay()

Package Sidebar

Install

npm i sleep.async

Weekly Downloads

1

Version

1.0.4

License

ISC

Last publish

Collaborators

  • 30kidz