From f39a12113a96d8bbc08aac55dec25437a5958dde Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Tue, 18 Aug 2020 16:37:02 +0300 Subject: [PATCH] doc: improve async_hooks snippets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/34829 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Gerhard Stöbich --- doc/api/async_hooks.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 7b535db3d4fbe0..9f6d61b0285930 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -273,7 +273,8 @@ async_hooks.createHook({ init(asyncId, type, triggerAsyncId) { const eid = async_hooks.executionAsyncId(); fs.writeSync( - 1, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); + process.stdout.fd, + `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); } }).enable(); @@ -325,7 +326,7 @@ async_hooks.createHook({ const eid = async_hooks.executionAsyncId(); const indentStr = ' '.repeat(indent); fs.writeSync( - 1, + process.stdout.fd, `${indentStr}${type}(${asyncId}):` + ` trigger: ${triggerAsyncId} execution: ${eid}\n`); },