Skip to content

Commit 6e3e50f

Browse files
committed
doc: improve async_context introduction
- Rename "Async_context" to "Asynchronous context tracking" in toc. - Use named imports to show how `AsyncLocalStorage` and `AsyncResource` can be imported. PR-URL: #40560 Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Voltrex <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
1 parent 488ee51 commit 6e3e50f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/api/async_context.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Asynchronous Context Tracking
1+
# Asynchronous context tracking
22

33
<!--introduced_in=v16.4.0-->
44

@@ -18,11 +18,11 @@ The `AsyncLocalStorage` and `AsyncResource` classes are part of the
1818
`async_hooks` module:
1919

2020
```mjs
21-
import async_hooks from 'async_hooks';
21+
import { AsyncLocalStorage, AsyncResource } from 'async_hooks';
2222
```
2323

2424
```cjs
25-
const async_hooks = require('async_hooks');
25+
const { AsyncLocalStorage, AsyncResource } = require('async_hooks');
2626
```
2727

2828
## Class: `AsyncLocalStorage`

doc/api/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<hr class="line"/>
1212

1313
* [Assertion testing](assert.md)
14-
* [Async\_context](async\_context.md)
14+
* [Asynchronous context tracking](async\_context.md)
1515
* [Async hooks](async\_hooks.md)
1616
* [Buffer](buffer.md)
1717
* [C++ addons](addons.md)

0 commit comments

Comments
 (0)