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

esm-itter

v1.0.4

Published

ESMitter is a fork of the popular EventEmitter3 with a focus on EcmaScript module syntax, TypeScript and modern tooling.

Readme

ESMitter

ESMitter (read: E-S-Emitter; a pun on ESM + emitter) is an event emitter compatible with Node.js, Deno and modern browsers. It is a fork of EventEmitter3, but natively TypeScript, ESM-only and with more modern tooling. The complete codebase has been converted to TypeScript and EcmaScript module syntax (ESM). ESMitter is currently less performant than EventEmitter3, but still fast with millions of operations per second.

Version npm Tests JSR JSR Score

Installation and Usage with Node.js

npm install --save esm-itter

After installation the only thing you need to do is import the module and use it as a parent class. One of the main features of ESMitter (beside being ESM-only) is that it is strongly typed, so you will need to provide type definitions for your events. Here is a simple example:

import { ESMitter, type ESMitterEvent } from "esm-itter";

class MyClass extends ESMitter<{
  success: ESMitterEvent<[{ foo: string; bar: string }]>;
  error: ESMitterEvent<[number, string]>;
}> {}

const instance = new MyClass();

// Attach event listener
instance.on("success", ({ foo, bar }) => {
  /* [...] */
});

Installation and Usage with Deno + JSR

deno add jsr:@tillsanders/esm-itter

After installation the only thing you need to do is import the module and use it as a parent class. One of the main features of ESMitter (beside being ESM-only) is that it is strongly typed, so you will need to provide type definitions for your events. Here is a simple example:

import { ESMitter, type ESMitterEvent } from "@tillsanders/esm-itter";

class MyClass extends ESMitter<{
  success: ESMitterEvent<[{ foo: string; bar: string }]>;
  error: ESMitterEvent<[number, string]>;
}> {}

const instance = new MyClass();

// Attach event listener
instance.on("success", ({ foo, bar }) => {
  /* [...] */
});

Tests and benchmarks

This module is well tested. You can run:

  • npm test to run the tests under Node.js.
  • npm run coverage to run the tests and generate a coverage report.

We also have a set of benchmarks to compare EventEmitter3 with some available alternatives. To run the benchmarks run npm run benchmark.

Tests and benchmarks are not included in the npm package. If you want to play with them you have to clone the GitHub repository. Note that you will have to run an additional npm i in the benchmarks folder before npm run benchmark.

Known incompatibilities with EventEmitter3

  • The listenerCount() method requires an event name as the first argument and will thus not return the number of listeners for all events combined.

Status

This library has been tested using unit tests and has achieved excellent code coverage. It is being used in production and is considered stable. Contributions are welcome to improve any aspect of the library, including performance, documentation, and features.

License & Authors

This module is licensed under MIT.

It is a fork of the wonderful EventEmitter3 by Arnout Kazemier and has been converted to TypeScript and ESM by Till Sanders. For ES3 and CommonJS support, as well as superior performance, please use EventEmitter3.