
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
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 5 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.