Skip to content

A tiny library to pass context down the call stack in a type-safe manner

License

Notifications You must be signed in to change notification settings

tlaanemaa/calling-context

Repository files navigation

Calling Context

This was an attempt to add call stack context into NodeJS. The approach was to annotate the call-stack with a custom function, giving us the ability to use that annotation as an ID to look up a previously stored context. Sadly though, the experiment failed due to how async operations break up the call-stack. Never the less, this serves as an interesting case study into NodeJS call-stack manipulation.

See the ./src/context.spec.ts for an example of how this implementation fails.

For a real solution to the problem of adding context to your call-stack, see async_context

About

A tiny library to pass context down the call stack in a type-safe manner

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published