async-context-id
[!TAG] 0.1.2
A lightweight, powerful correlation ID tracking and context store written for Node.js that automatically propagates context through async operations using Node's async_hooks
. Perfect for distributed tracing, request tracking, and logging correlation in micro services architectures.
Table of Contents
Features
- Automatic context propagation through async operations
- Thread-local-like storage for Node.js
- UUID v4 based correlation IDs
- ️ Thread-safe context isolation
- Deep cloning of context data
- Automatic cleanup of contexts
- Zero dependencies (uses only Node.js built-ins)
Installation
NPM
npm install @psenger/async-context-id --save
YARN
yarn add @psenger/async-context-id
Contributing
Thanks for contributing! 😁 Here are some rules that will make your change to markdown-fences fruitful.
Rules
- Raise a ticket to the feature or bug can be discussed
- Pull requests are welcome, but must be accompanied by a ticket approved by the repo owner
- You are expected to add a unit test or two to cover the proposed changes.
- Please run the tests and make sure tests are all passing before submitting your pull request
- Do as the Romans do and stick with existing whitespace and formatting conventions (i.e., tabs instead of spaces, etc)
- we have provided the following:
.editorconfig
and.eslintrc
- Don't tamper with or change
.editorconfig
and.eslintrc
- we have provided the following:
- Please consider adding an example under examples/ that demonstrates any new functionality
Commit Message
This module uses release-please which needs commit messages to look like the following Conventional Commits
<type>[optional scope]: <description>
[optional body]
type is typically fix
, feat
. When type ends with a !
or is BREAKING CHANGE
it indicates this is a breaking change.
type should be followed by a short description,
optional body can have more detail
Testing
- All tests are expected to work
- Tests are based off of
dist/index.js
NOT your src code. Therefore, you should BUILD it first. - Coverage should not go down, and I acknowledge it is very difficult to get the tests to 100%
License
MIT License
Copyright (c) 2025 Philip A Senger
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Acknowledgments
This project directly uses the following open-source packages:
Dependencies
- None
Development Dependencies
- @psenger/markdown-fences - MIT License
- eslint-config-prettier - MIT License
- eslint-plugin-jest - MIT License
- eslint-plugin-prettier - MIT License
- eslint - MIT License
- jest-html-reporters - MIT License
- jest - MIT License
- jsdoc - Apache-2.0 License
- license-checker - BSD-3-Clause License
- markdown-toc - MIT License
- prettier - MIT License
- rimraf - ISC License
- rollup - MIT License
- standard-version - ISC License