Skip to content

Commit

Permalink
doc: declare path on example of async_hooks.executionAsyncId()
Browse files Browse the repository at this point in the history
Example is not runnable because `path` is used, but it's not
declared.

PR-URL: #48556
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
deokjinkim authored and RafaelGSS committed Aug 15, 2023
1 parent 41929a2 commit 388c7d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ import { executionAsyncId } from 'node:async_hooks';
import fs from 'node:fs';

console.log(executionAsyncId()); // 1 - bootstrap
const path = '.';
fs.open(path, 'r', (err, fd) => {
console.log(executionAsyncId()); // 6 - open()
});
Expand All @@ -778,6 +779,7 @@ const async_hooks = require('node:async_hooks');
const fs = require('node:fs');

console.log(async_hooks.executionAsyncId()); // 1 - bootstrap
const path = '.';
fs.open(path, 'r', (err, fd) => {
console.log(async_hooks.executionAsyncId()); // 6 - open()
});
Expand Down

0 comments on commit 388c7d9

Please sign in to comment.