From d5484046922b3d0bdedd9fee0709051bbc2fa77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 22 Oct 2021 13:58:33 +0200 Subject: [PATCH] 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. --- doc/api/async_context.md | 6 +++--- doc/api/index.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/async_context.md b/doc/api/async_context.md index c944d25d34ad56..137a84151f0da1 100644 --- a/doc/api/async_context.md +++ b/doc/api/async_context.md @@ -1,4 +1,4 @@ -# Asynchronous Context Tracking +# Asynchronous context tracking @@ -18,11 +18,11 @@ The `AsyncLocalStorage` and `AsyncResource` classes are part of the `async_hooks` module: ```mjs -import async_hooks from 'async_hooks'; +import { AsyncLocalStorage, AsyncResource } from 'async_hooks'; ``` ```cjs -const async_hooks = require('async_hooks'); +const { AsyncLocalStorage, AsyncResource } = require('async_hooks'); ``` ## Class: `AsyncLocalStorage` diff --git a/doc/api/index.md b/doc/api/index.md index 0e7bf073d2843c..7aba47edcb35af 100644 --- a/doc/api/index.md +++ b/doc/api/index.md @@ -11,7 +11,7 @@
* [Assertion testing](assert.md) -* [Async\_context](async\_context.md) +* [Asynchronous context tracking](async\_context.md) * [Async hooks](async\_hooks.md) * [Buffer](buffer.md) * [C++ addons](addons.md)