
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
event-tracker-wrapper
Advanced tools
English | 中文
Please note that types are for reference only. They are not the actual types.
createEventTracker
function createEventTracker<Events, StartOptions, EventOptions>(
options: EventTrackerOptions<Events, StartOptions, EventOptions>
): EventTracker<Events, StartOptions, EventOptions>;
type EventTrackerOptions<Events, StartOptions, EventOptions> = {
autostart?: boolean;
onEvent?: (arg: {
level: "debug" | "info" | "warn" | "error";
name: string;
message: string;
payload: unknown;
options: EventOptions;
startOptions: StartOptions;
}) => void;
};
type EventTracker<Events, StartOptions, EventOptions> = {
start: () => void;
debug: (event: {
name: string;
message: string;
payload: unknown;
options: EventOptions;
}) => void;
info: Function; // same as debug
warn: Function; // same as debug
error: Function; // same as debug
};
event-tracker-wrapper
seems only work for event track. How to deal with normal log?Normal log can be viewed as event, you can do like this:
import { createEventTracker } from "event-tracker-wrapper";
type Events = {
debug: {
LOG: undefined;
};
info: {
LOG: undefined;
};
warn: {
LOG: undefined;
};
error: {
LOG: undefined;
};
};
const tracker = createEventTracker<Events>();
tracker.info({
name: "LOG",
message: "info log",
});
import { createEventTracker } from "event-tracker-wrapper";
import type { Reporter } from "takes-long-time-to-import-reporter";
// in package-a
export const tracker = createEventTracker<Events, Reporter>({
autostart: false,
});
// in package-b
import { tracker } from "package-a";
// after TTI
{
import("takes-long-time-to-import-reporter").then((reporter) => {
tracker.start(reporter);
});
}
FAQs
provide unified interface for event tracking
The npm package event-tracker-wrapper receives a total of 0 weekly downloads. As such, event-tracker-wrapper popularity was classified as not popular.
We found that event-tracker-wrapper 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.