0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/doc
James M Snell a8904e8eee
timers: introduce timers/promises
Move the promisified timers implementations into a new sub-module
to avoid the need to promisify. The promisified versions now return
the timers/promises versions.

Also adds `ref` option to the promisified versions

```js
const {
  setTimeout,
  setImmediate
} = require('timers/promises');

setTimeout(10, null, { ref: false })
  .then(console.log);

setImmediate(null, { ref: false })
  .then(console.log);

```

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33950
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-22 14:29:49 -07:00
..
api timers: introduce timers/promises 2020-06-22 14:29:49 -07:00
api_assets doc,tools: properly syntax highlight API ref docs 2020-05-23 18:11:11 +02:00
changelogs 2020-06-17, Version 12.18.1 'Erbium' (LTS) 2020-06-17 09:26:19 -07:00
guides doc: standardize on sentence case for headers 2020-06-19 08:09:59 -07:00
.eslintrc.yaml
abi_version_registry.json doc: claim ABI version 85 for Electron 11 2020-05-20 13:26:45 +02:00
first_timer_badge.png
full-white-stripe.jpg
node.1 lib: unflag AbortController 2020-06-05 12:21:49 -07:00
osx_installer_logo.png
template.html doc,tools: properly syntax highlight API ref docs 2020-05-23 18:11:11 +02:00
thin-white-stripe.jpg