Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3abcc74

Browse filesBrowse 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 fd4f561 commit 3abcc74
Copy full SHA for 3abcc74

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/async_hooks.md‎

Copy file name to clipboardExpand all lines: doc/api/async_hooks.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.