timers-promises

1.0.1 • Public • Published

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

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

Kudos

Development of this module is sponsored by Transloadit.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i timers-promises

Weekly Downloads

4,013

Version

1.0.1

License

MIT

Unpacked Size

10.5 kB

Total Files

7

Last publish

Collaborators

  • juliangruber