
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
Minimal event emitter
const unemit = require("unemit");
const emitter = unemit();
const unsubscribe = emitter.on("type", data => {
console.log(data);
});
emitter.emit("type", { foo: "bar" });
unemit()Returns an Emitter object
Emitter.emit(type, event)Emits an event of type type. Will call the handlers with handler(event).
Emitter.on(type, handler)Registers a handler for events of type type. Returns a function that removes the handler.
const unsubscribe = emitter.on("type", handler);
unsubscribe();
Unlike other libraries, unevent will prevent registering the same handler twice for the same event type.
Emitter.off(type, handler)Removes a handler from events of type type.
Emitter.once(type, handler)Registers a handler for only the first event of type type. It's equivalent to:
function handler() {
emitter.off("type", handler);
}
emitter.on("type", handler);
This library was inspired by mitt.
FAQs
Minimal event emitter
We found that unemit 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
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.