
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
context-tracer
Advanced tools
Propagates a unique context ID throughout calls. Similar to Java MDC and the likes.
For node 6+.
Returns a callback, augmented with a unique context UUID. Within this callback, all operations (and their childs) will inherit the unique ID.
tracer.set(() => {
// all nested calls have now access to a unique context ID
console.log(tracer.get()); // you can now log it
});
The following code :
const tracer = require("context-tracer");
function callThings() {
nested();
}
function nested() {
console.log("nested call - stack n°", tracer.get());
}
tracer.set(() => {
console.log("first call - stack n°", tracer.get());
// called within the tracer, and inherits the ID
callThings();
});
Will print :
> first call : stack n°AAAA
> nested call : stack n°AAAA
> npm install context-tracer
tracer.set(() => {
// all operations called within the tracer will inherit a unique context ID
});
You can nest context augments : the new context ID will override the previous one, only for its callback operations.
stringconsole.log("stack n°" + tracer.get());
> stack n°AAAA
While this package supports node 6-7, the underlying architecture is considered experimental for these versions. Read more here.
This project is made using Typescript. To generate the transpiled javascript package, you need to run gulp :
$ gulp
You can run the full test suite with mocha :
$ npm i && npm run test
FAQs
context tracing for node event loop
We found that context-tracer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.