
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
tfg-event-context-plugin-node
Advanced tools
node plugin for tfg-event-context (Universal event context library for JavaScript)
ctx.getState()ctx.dispose()Make EventContext package aware of jQuery bindings
npm i -S tfg-event-context tfg-event-context-plugin-node
This is super useful to getting the request that causing an unexpected error. See the example below, it was not easy to get the req inside a downstream function without explicitly passing the req along the way.
import { withContext, getCurrentContext } from 'tfg-event-context';
import { patch } from 'tfg-event-context-plugin-node';
// patch all NodeJS binding after this call
patch();
const server = http.createServer(withContext((req, res) => {
const ctx = getCurrentContext();
const state = ctx.getState();
state.req = req;
handleRequest(req.path, (err, value) => {
res.end(value);
});
}));
function handleRequest(path, callback) {
// do some works with path
process.nextTick(() => {
callDB(callback);
});
}
function callDB(callback) {
try {
somethingWrong();
} catch (ex) {
const ctx = currentContext();
const { req } = ctx.getState();
const { method, url } = req;
console.error('Server Error. Gracefully dying. Request causing error: ', method, url);
}
}
When you decide to stop all event listeners created in an context, just call ctx.dispose()
const ctx = getCurrentContext();
ctx.dispose()
All bound event handlers within the context will be removed.
EventContext for jQuery https://www.npmjs.com/package/tfg-event-context-plugin-jquery
FAQs
node plugin for tfg-event-context (Universal event context library for JavaScript)
We found that tfg-event-context-plugin-node 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.