summaryrefslogtreecommitdiff
path: root/doc/api/async_hooks.md
diff options
context:
space:
mode:
authorAndrey Pechkurov <apechkurov@gmail.com>2020-08-18 16:37:02 +0300
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2020-08-20 15:05:22 +0100
commit969fb1c5e39a17c4442459af9e6211f315926073 (patch)
tree7b60592ee43bd1957c9c9dd7e7b3367ae736c6d7 /doc/api/async_hooks.md
parent3360dcbfab12fd09aa54785589e1f2740668b973 (diff)
downloadnode-new-969fb1c5e39a17c4442459af9e6211f315926073.tar.gz
doc: improve async_hooks snippets
PR-URL: https://github.com/nodejs/node/pull/34829 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Diffstat (limited to 'doc/api/async_hooks.md')
-rw-r--r--doc/api/async_hooks.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md
index 74abab4fa7..921147f5cc 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`);
},