GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: fix fs missing import · nodejs/node@ea7fb16

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • async_hooks.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/async_hooks.md‎

Copy file name to clipboardExpand all lines: doc/api/async_hooks.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.