@@ -4963,6 +4963,30 @@ certificates added with [`--use-system-ca`][] or [`NODE_EXTRA_CA_CERTS`][].
49634963Use [` tls .getCACertificates (' default' )` ][] to get the default CA certificates,
49644964or ` tls .getCACertificates (' bundled' )` to get the bundled Mozilla CA store.
49654965
4966+ ### DEP0215: ` async_hooks .createHook ()`
4967+
4968+ <!-- YAML
4969+ changes:
4970+ - version: REPLACEME
4971+ pr-url: https://github.com/nodejs/node/pull/67271
4972+ description: Runtime deprecation.
4973+ -->
4974+
4975+ Type: Runtime
4976+
4977+ [` async_hooks .createHook ()` ][] is deprecated. The callbacks it registers run for
4978+ every asynchronous resource created in the process, which has a significant
4979+ performance cost, and they expose internal implementation details that change
4980+ between Node.js versions.
4981+
4982+ Use [` AsyncLocalStorage` ][] to propagate state across asynchronous operations,
4983+ and [` diagnostics_channel` ][] (in particular [` TracingChannel` ][]) to observe
4984+ operations for tracing and monitoring. [` process .getActiveResourcesInfo ()` ][]
4985+ returns the types of the resources that keep the event loop alive.
4986+
4987+ ` async_hooks .createHook ()` may be put behind a command-line flag or removed in
4988+ a future version of Node.js.
4989+
49664990[DEP0142]: #dep0142-repl_builtinlibs
49674991[DEP0156]: #dep0156-aborted-property-and-abort-aborted-event-in-http
49684992[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
@@ -4977,6 +5001,7 @@ or `tls.getCACertificates('bundled')` to get the bundled Mozilla CA store.
49775001[` -- throw - deprecation` ]: cli.md#--throw-deprecation
49785002[` -- unhandled- rejections` ]: cli.md#--unhandled-rejectionsmode
49795003[` -- use- system- ca` ]: cli.md#--use-system-ca
5004+ [` AsyncLocalStorage` ]: async_context.md#class-asynclocalstorage
49805005[` Buffer .allocUnsafeSlow (size)` ]: buffer.md#static-method-bufferallocunsafeslowsize-alignment
49815006[` Buffer .from (array)` ]: buffer.md#static-method-bufferfromarray
49825007[` Buffer .from (buffer)` ]: buffer.md#static-method-bufferfrombuffer
@@ -4995,9 +5020,11 @@ or `tls.getCACertificates('bundled')` to get the bundled Mozilla CA store.
49955020[` Server .getConnections ()` ]: net.md#servergetconnectionscallback
49965021[` Server .listen ({fd: < number> })` ]: net.md#serverlistenhandle-backlog-callback
49975022[` String .prototype .toWellFormed ` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toWellFormed
5023+ [` TracingChannel` ]: diagnostics_channel.md#class-tracingchannel
49985024[` WriteStream .open ()` ]: fs.md#class-fswritestream
49995025[` assert` ]: assert.md
50005026[` asyncResource .runInAsyncScope ()` ]: async_context.md#asyncresourceruninasyncscopefn-thisarg-args
5027+ [` async_hooks .createHook ()` ]: async_hooks.md#async_hookscreatehookoptions
50015028[` buffer .subarray ` ]: buffer.md#bufsubarraystart-end
50025029[` child_process .execFile ` ]: child_process.md#child_processexecfilefile-args-options-callback
50035030[` child_process .exec ` ]: child_process.md#child_processexeccommand-options-callback
@@ -5017,6 +5044,7 @@ or `tls.getCACertificates('bundled')` to get the bundled Mozilla CA store.
50175044[` crypto .scrypt ()` ]: crypto.md#cryptoscryptpassword-salt-keylen-options-callback
50185045[` decipher .final ()` ]: crypto.md#decipherfinaloutputencoding
50195046[` decipher .setAuthTag ()` ]: crypto.md#deciphersetauthtagbuffer-encoding
5047+ [` diagnostics_channel` ]: diagnostics_channel.md
50205048[` dirent .parentPath ` ]: fs.md#direntparentpath
50215049[` dns .lookup ()` ]: dns.md#dnslookuphostname-options-callback
50225050[` dnsPromises .lookup ()` ]: dns.md#dnspromiseslookuphostname-options
0 commit comments