Skip to content

Commit ea7fb16

Browse files
jakecastellidanielleadams
authored andcommitted
doc: fix fs missing import
PR-URL: #46907 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Debadree Chatterjee <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]>
1 parent 96a39d1 commit ea7fb16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/async_hooks.md

+4
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ The following is a simple demonstration of `triggerAsyncId`:
375375
import { createHook, executionAsyncId } from 'node:async_hooks';
376376
import { stdout } from 'node:process';
377377
import net from 'node:net';
378+
import fs from 'node:fs';
378379

379380
createHook({
380381
init(asyncId, type, triggerAsyncId) {
@@ -392,6 +393,7 @@ net.createServer((conn) => {}).listen(8080);
392393
const { createHook, executionAsyncId } = require('node:async_hooks');
393394
const { stdout } = require('node:process');
394395
const net = require('node:net');
396+
const fs = require('node:fs');
395397

396398
createHook({
397399
init(asyncId, type, triggerAsyncId) {
@@ -722,6 +724,7 @@ changes:
722724
723725
```mjs
724726
import { executionAsyncId } from 'node:async_hooks';
727+
import fs from 'node:fs';
725728

726729
console.log(executionAsyncId()); // 1 - bootstrap
727730
fs.open(path, 'r', (err, fd) => {
@@ -731,6 +734,7 @@ fs.open(path, 'r', (err, fd) => {
731734
732735
```cjs
733736
const async_hooks = require('node:async_hooks');
737+
const fs = require('node:fs');
734738

735739
console.log(async_hooks.executionAsyncId()); // 1 - bootstrap
736740
fs.open(path, 'r', (err, fd) => {

0 commit comments

Comments
 (0)