Skip to content

Commit

Permalink
doc: correct cjs code to match mjs code
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
rluvaton authored and danielleadams committed Aug 16, 2021
1 parent f18bb2a commit 5d66646
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5d66646

Please sign in to comment.