From 5e17c0ae0616679bedf096d00b209187d2235e0e 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 --- 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`); },