Skip to main content
Home
Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
Downloads1/wk
Published10 months ago (0.2.0)

Small event emitter

events

Small event emitter

const emitter = new EventEmitter<{
	add: [text: string];
	clear: [];
}>();

emitter.on('add', (text) => {
	console.log({ text });
});

emitter.emit('add', `Hello world!`);

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@mary/events

Import symbol

import * as events from "@mary/events";
or

Import directly with a jsr specifier

import * as events from "jsr:@mary/events";

Add Package

pnpm i jsr:@mary/events
or (using pnpm 10.8 or older)
pnpm dlx jsr add @mary/events

Import symbol

import * as events from "@mary/events";

Add Package

yarn add jsr:@mary/events
or (using Yarn 4.8 or older)
yarn dlx jsr add @mary/events

Import symbol

import * as events from "@mary/events";

Add Package

vlt install jsr:@mary/events

Import symbol

import * as events from "@mary/events";

Add Package

npx jsr add @mary/events

Import symbol

import * as events from "@mary/events";

Add Package

bunx jsr add @mary/events

Import symbol

import * as events from "@mary/events";