Files
node/doc/api
James M Snell a369818b1e lib: add defaultValue and name options to AsyncLocalStorage
The upcoming `AsyncContext` specification adds a default value and name
to async storage variables. This adds the same to `AsyncLocalStorage`
to promote closer alignment with the pending spec.

```js
const als = new AsyncLocalStorage({
  name: 'foo',
  defaultValue: 123,
});

console.log(als.name);  // 'foo'
console.log(als.getStore());  // 123
```

Refs: https://github.com/tc39/proposal-async-context/blob/master/spec.html
PR-URL: https://github.com/nodejs/node/pull/57766
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-04-07 13:41:18 -07:00
..
2024-12-15 14:19:27 +00:00
2025-02-26 17:34:53 +01:00
2024-11-01 03:43:53 +00:00
2025-04-02 09:37:43 +00:00
2024-08-19 13:52:40 +00:00
2025-04-04 12:53:31 +00:00
2025-01-07 14:36:47 -05:00
2025-01-31 12:47:09 +01:00
2025-03-28 14:49:59 +01:00
2024-11-20 10:10:38 +00:00
2025-02-13 18:28:25 +01:00
2024-11-20 23:26:30 +00:00
2025-03-23 14:51:41 +00:00
2025-03-21 08:22:02 -07:00
2024-07-21 15:44:27 +00:00