mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
doc: correct cjs code to match mjs code
PR-URL: https://github.com/nodejs/node/pull/39509 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
This commit is contained in:
1 parent
f18bb2a0f1
commit
5d66646b71
1 file changed
+2
-2
@@ -374,14 +374,14 @@ net.createServer((conn) => {}).listen(8080);
|
||||
|
||||
```cjs
|
||||
const { createHook, executionAsyncId } = require('async_hooks');
|
||||
const { fd } = require('process').stdout;
|
||||
const { stdout } = require('process');
|
||||
const net = require('net');
|
||||
|
||||
createHook({
|
||||
init(asyncId, type, triggerAsyncId) {
|
||||
const eid = executionAsyncId();
|
||||
fs.writeSync(
|
||||
fd,
|
||||
stdout.fd,
|
||||
`${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`);
|
||||
}
|
||||
}).enable();
|
||||
|
||||
Reference in new issue
Block a user