This commit is contained in:
2026-02-15 20:09:47 +00:00
parent 7f09f1b6f4
commit 0c13bf6be4
9 changed files with 3423 additions and 3043 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartcontext',
version: '2.2.1',
version: '2.3.0',
description: 'A module providing advanced asynchronous context management to enrich logs with context and manage scope effectively in Node.js applications.'
}

View File

@@ -2,10 +2,10 @@ import * as plugins from './plugins.js';
import { AsyncStore } from './classes.asyncstore.js';
export class AsyncContext {
private _context = new plugins.simpleAsyncContext.AsyncContext.Variable<AsyncStore>();
private _context = new plugins.AsyncLocalStorage<AsyncStore>();
private _store = new AsyncStore();
get store() {
return this._context.get() || this._store;
return this._context.getStore() || this._store;
}
set store(value: AsyncStore) {
this._store = value;

View File

@@ -1,4 +1,3 @@
// third party scope
import simpleAsyncContext from 'simple-async-context';
import { AsyncLocalStorage } from 'node:async_hooks';
export { simpleAsyncContext };
export { AsyncLocalStorage };