From a8904e8eeea3ca513de588424bb99f6a7cdfc598 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 18 Jun 2020 13:22:17 -0700 Subject: 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 PR-URL: https://github.com/nodejs/node/pull/33950 Reviewed-By: Denys Otrishko Reviewed-By: Benjamin Gruenbaum --- node.gyp | 1 + 1 file changed, 1 insertion(+) (limited to 'node.gyp') diff --git a/node.gyp b/node.gyp index 0af72d48c25..6d9e9cb3fc0 100644 --- a/node.gyp +++ b/node.gyp @@ -85,6 +85,7 @@ 'lib/_stream_wrap.js', 'lib/string_decoder.js', 'lib/sys.js', + 'lib/timers/promises.js', 'lib/timers.js', 'lib/tls.js', 'lib/_tls_common.js', -- cgit v1.2.3