1.0.1 • Published 4 years ago

timers-promises v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

timers-promises

Timers Promises API, for node 14 and below.

Example

const timers = require('timers-promises')
const AbortController = require('abort-controller')

await timers.setTimeout(5000)

// With abort
const controller = new AbortController()
await timers.setTimeout(10000, 'value', {
  signal: controller.signal
})
// in another context
controller.abort()

API

See https://nodejs.org/api/timers.html#timers_timers_promises_api.

Roadmap

  • setTimeout([delay[, value[, options]]])
  • setImmediate([value[, options]])
  • setInterval([delay[, value[, options]]])

Kudos

Development of this module is sponsored by Transloadit.

License

MIT