
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
eventsafets
Advanced tools
Un EventEmitter seguro y tipado para Node.js y TypeScript 🚀. Define tus eventos con tipos y obtén autocompletado, seguridad en tiempo de compilación y una API sencilla.
pnpm add eventsafets
# o
npm install eventsafets
# o
yarn add eventsafets
import { EventSafeTS } from "eventsafets";
// 1. Define tus eventos
type Events = {
login: { userId: string };
logout: { reason: string };
};
// 2. Crea un emitter tipado
const emitter = new EventSafeTS<Events>();
// 3. Suscríbete a un evento
emitter.on("login", (data) => {
console.log("Usuario logueado:", data.userId);
});
// 4. Emitir un evento
emitter.emit("login", { userId: "carlos" });
on, off, once y emitnew EventSafeTS<T>()Crea una nueva instancia tipada.
T debe ser un objeto donde la clave es el nombre del evento y el valor es el payload.
.on(event, listener)Registra un listener para un evento.
.off(event, listener)Elimina un listener.
.once(event, listener)Listener que se ejecuta solo una vez.
.emit(event, payload)Emite un evento con su payload tipado.
El proyecto usa Vitest. Ejecuta las pruebas con:
pnpm test
pnpm build
git checkout -b feature/nueva-funcionalidad)git commit -m "Agrega nueva funcionalidad")git push origin feature/nueva-funcionalidad)MIT © 2025 Carlos Ignacio Olano Mares
FAQs
Un EventEmitter seguro y tipado para Node.js y TypeScript
We found that eventsafets demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.