new AsyncLocalStorage([options])


  • options <Object>
    • defaultValue <any> 当未提供存储时使用的默认值。
    • name <string> AsyncLocalStorage 值的名称。

创建一个新的 AsyncLocalStorage 实例。存储仅在 run() 调用中或在 enterWith() 调用之后提供。

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