nestjs-cls
nestjs-cls copied to clipboard
A continuation-local storage (async context) module compatible with NestJS's dependency injection.
(relates to #18) Consider adding a `@UseCls()` method decorator to set up the context for a method automagically, when it is run outside of a request context. ```ts // This...
If the project grows, we'll need contributing guidelines -> create a `CONTRIBUTING.md` file with steps.
[Namespaces](https://github.com/Papooch/nestjs-cls#namespaces-experimental) are a remnant from the early implementation based on `cls-hooked`, but I've never found an useful application for them, therefore I've decided to remove them to clean up the...
This is still just an idea, but I think it's very much possible to use a [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) in combination of CLS to create a truly request-scoped providers in the Nest...
I suggest adding additional sections to the README or FAQ: ### Performance concerns with AsyncLocalStorage? This question sometimes arises because of early concerns with async_hooks performance. See for example: https://github.com/iamolegga/nestjs-pino/issues/322...
This PR adds the ability to specify default options for the `@Transactional` decorator, so that they don't need to be specified repeatedly.
I'd stayed away from using AsyncLocalStorage due to performance concerns for a while, but since Otel uses it anyway, using it for CLS shouldn't add any additional overhead. So... I...
It might be possible to emulate the behavior of [Durable Providers](https://docs.nestjs.com/fundamentals/injection-scopes#durable-providers) with CLS as well, where we could retrieve the same context instance in multiple subsequent requests. A proper solution...
Fixes #149 by using a Proxy object to avoid overiding descriptor.value inside the decorator.