
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
An application execution context to pass around, attach stuff to, make child contexts/request specific contexts
Creates a single application context to which you can attach (maybe mock) services for your application.
You can make them instantiate per-child context or be static.
They can have custom shutdown handling when a child context is disposed.
There is also an express middleware to ease writing HTTP based apps the use context.
This uses app-ctx/default which has some sugar, but requires the optional dependencies: cuid, winston and chalk.
const { createBackgroundContext, staticProp } = require("app-ctx/default");
const bg = createBackgroundContext({ foo: staticProp("bar") });
// the default context attaches a nice logger
bg.log("this is the background");
// the prop is available
console.log(bg.foo); // "bar"
const child = bg.child();
// and on the children
console.log(child.foo); // "bar"
await someLongAsyncFunctionDoingStuff(child);
// clean up.
await child.done();
//how long did that take?
bg.log("uptime: %d", bg.lifetime());
await bg.done();
bg.log; // throws error on access now context is `done`
Of course this is simple. but the api allows per-child instances, so you could have per-request caches, or like the logging example, per-request Id's which are automatically attached to the logger. Another useful one if proxying a database, to ensure all handles are closed after the context is done.
That is now 99% of all use-cases I have had for this.
FAQs
An application execution context to pass around, attach stuff to, make child contexts/request specific contexts
The npm package app-ctx receives a total of 12 weekly downloads. As such, app-ctx popularity was classified as not popular.
We found that app-ctx 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.