@@ -375,6 +375,7 @@ The following is a simple demonstration of `triggerAsyncId`:
375375import { createHook , executionAsyncId } from ' node:async_hooks' ;
376376import { stdout } from ' node:process' ;
377377import net from ' node:net' ;
378+ import fs from ' node:fs' ;
378379
379380createHook ({
380381 init (asyncId , type , triggerAsyncId ) {
@@ -392,6 +393,7 @@ net.createServer((conn) => {}).listen(8080);
392393const { createHook , executionAsyncId } = require (' node:async_hooks' );
393394const { stdout } = require (' node:process' );
394395const net = require (' node:net' );
396+ const fs = require (' node:fs' );
395397
396398createHook ({
397399 init (asyncId , type , triggerAsyncId ) {
@@ -722,6 +724,7 @@ changes:
722724
723725` ` ` mjs
724726import { executionAsyncId } from ' node:async_hooks' ;
727+ import fs from ' node:fs' ;
725728
726729console .log (executionAsyncId ()); // 1 - bootstrap
727730fs .open (path, ' r' , (err , fd ) => {
@@ -731,6 +734,7 @@ fs.open(path, 'r', (err, fd) => {
731734
732735` ` ` cjs
733736const async_hooks = require (' node:async_hooks' );
737+ const fs = require (' node:fs' );
734738
735739console .log (async_hooks .executionAsyncId ()); // 1 - bootstrap
736740fs .open (path, ' r' , (err , fd ) => {
0 commit comments