sleep.async

Super simple promisify sleep module.

Usage no npm install needed!

<script type="module">
  import sleepAsync from 'https://cdn.skypack.dev/sleep.async';
</script>

README

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()