new AsyncLocalStorage([options])


  • options <Object>

    • defaultValue <any> 未提供存储时使用的默认值。

      ¥defaultValue <any> The default value to be used when no store is provided.

    • name <string> AsyncLocalStorage 值的名称。

      ¥name <string> A name for the AsyncLocalStorage value.

创建 AsyncLocalStorage 的新实例。Store 仅在 run() 调用内或 enterWith() 调用后提供。

¥Creates a new instance of AsyncLocalStorage. Store is only provided within a run() call or after an enterWith() call.