sleep-promise-native

1.0.0 • Public • Published

sleep.async

Super simple promisify sleep module.

Install

npm i sleep-promise-native --save

sleep(delay)

const sleep = require('sleep-promise-native')
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-promise-native')
 
const delay = async (() => {
  await (sleep(2000))
  console.log('2000ms later.')
})
delay()

Package Sidebar

Install

npm i sleep-promise-native

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

1.73 kB

Total Files

5

Last publish

Collaborators

  • tomoaki