npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eolthar/events

v2.0.0

Published

A lightweight, high-performance event emitter for fast and scalable projects.

Readme

@eolthar/events

A lightweight, high-performance event emitter for fast and scalable projects.

npm i @eolthar/events

Benchmark

| Category | @eolthar/events | tseep | EventEmitter3 | NanoEvents | mitt | | :-------------------------------- | --------------: | --------: | ------------: | ------------: | --------: | | 1. Mass subscription and emit | 4 151 932 | 3 875 026 | 3 225 172 | 3 774 587 | 3 276 026 | | 2. Unsubscribe | 6 198 889 | 6 286 916 | 4 384 381 | 7 885 637 | 5 295 300 | | 3. on → emit → off | 2 348 937 | 2 727 954 | 2 509 048 | 3 543 034 | 2 744 207 | | 4. emit (0 arguments) | 10 397 673 | 8 126 418 | 6 837 431 | 8 565 591 | 6 764 343 | | 5. emit (5 arguments) | 9 915 638 | 8 080 340 | 6 901 530 | 7 531 209 | 6 454 089 | | 6. emit (10 arguments) | 9 183 703 | 7 561 947 | 4 503 834 | 6 767 050 | 6 023 215 |

Usage

const { Emitter } = require("@eolthar/events");

const emitter = new Emitter();

function handler(name) {
    console.log(`Hello, ${name}!`);
}

// Subscribe to an event
emitter.on("hello", handler);

// Emit an event
emitter.emit("hello", "Alice"); // Hello, Alice!

// Unsubscribe from the event
emitter.off("hello", handler);

// Emitting again won't call the listener
emitter.emit("hello", "Bob"); // nothing happens

API

new Emitter()

Creates a new event emitter instance.

emitter.on(event, listener)

Subscribes a listener to a named event.

emitter.on("data", (value) => console.log(value));

emitter.off(event, listener)

Removes a specific listener from an event.

function handler(value) {
    console.log(value);
}

emitter.on("data", handler);
emitter.off("data", handler);

emitter.once(event, listener)

Subscribes a listener that is automatically removed after the first call. Returns the internal wrapper function, which can be passed to off to manually remove the listener before it fires.

emitter.once("connect", () => console.log("connected!"));
emitter.emit("connect"); // connected!
emitter.emit("connect"); // nothing happens

emitter.emit(event, ...args)

Emits the specified event, calling all registered listeners in the order they were added.

emitter.emit("data", 1, 2, 3);

emitter.clear(event?)

Removes all listeners for a specific event. If no event is provided, clears all events.

emitter.clear("data"); // removes all listeners for "data"
emitter.clear(); // removes everything

License

MIT