Skip to content

Commit d1c9afa

Browse files
puzpuzpuzaddaleax
authored andcommitted
doc: improve async_hooks snippets
PR-URL: #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>
1 parent 5ba3d08 commit d1c9afa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/async_hooks.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ async_hooks.createHook({
273273
init(asyncId, type, triggerAsyncId) {
274274
const eid = async_hooks.executionAsyncId();
275275
fs.writeSync(
276-
1, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`);
276+
process.stdout.fd,
277+
`${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`);
277278
}
278279
}).enable();
279280

@@ -330,7 +331,7 @@ async_hooks.createHook({
330331
const eid = async_hooks.executionAsyncId();
331332
const indentStr = ' '.repeat(indent);
332333
fs.writeSync(
333-
1,
334+
process.stdout.fd,
334335
`${indentStr}${type}(${asyncId}):` +
335336
` trigger: ${triggerAsyncId} execution: ${eid}\n`);
336337
},

0 commit comments

Comments
 (0)