Gathering detailed insights and metrics for eventemitter3
Gathering detailed insights and metrics for eventemitter3
Gathering detailed insights and metrics for eventemitter3
Gathering detailed insights and metrics for eventemitter3
@types/eventemitter3
Stub TypeScript definitions entry for eventemitter3, which provides its own types definitions
hookified
Event Emitting and Middleware Hooks
tiny-typed-emitter
Fully type-checked EventEmitter
@ryancavanaugh/eventemitter3
Type definitions for EventEmitter3 1.1.1 from https://www.github.com/DefinitelyTyped/DefinitelyTyped
EventEmitter3 - Because there's also a number 2. And we're faster.
npm install eventemitter3
Typescript
Module System
Node Version
NPM Version
99.8
Supply Chain
98
Quality
80
Maintenance
100
Vulnerability
100
License
JavaScript (98.04%)
HTML (1.6%)
Shell (0.36%)
Total Downloads
7,238,644,213
Last Day
2,479,595
Last Week
46,330,931
Last Month
201,776,107
Last Year
1,931,448,352
MIT License
3,439 Stars
373 Commits
228 Forks
36 Watchers
1 Branches
28 Contributors
Updated on Jun 30, 2025
Minified
Minified + Gzipped
Latest Version
5.0.1
Package Id
eventemitter3@5.0.1
Unpacked Size
71.67 kB
Size
11.81 kB
File Count
12
NPM Version
9.6.4
Node Version
20.0.0
Published on
Apr 30, 2023
Cumulative downloads
Total Downloads
Last Day
-10.6%
2,479,595
Compared to previous day
Last Week
-9%
46,330,931
Compared to previous week
Last Month
1.4%
201,776,107
Compared to previous month
Last Year
41.5%
1,931,448,352
Compared to previous year
EventEmitter3 is a high performance EventEmitter. It has been micro-optimized for various of code paths making this, one of, if not the fastest EventEmitter available for Node.js and browsers. The module is API compatible with the EventEmitter that ships by default with Node.js but there are some slight differences:
throw
an error when you emit an error
event and nobody is
listening.newListener
and removeListener
events have been removed as they
are useful only in some uncommon use-cases.setMaxListeners
, getMaxListeners
, prependListener
and
prependOnceListener
methods are not available.fn.bind
.removeListener
method removes all matching listeners, not only the
first.It's a drop in replacement for existing EventEmitters, but just faster. Free performance, who wouldn't want that? The EventEmitter is written in EcmaScript 3 so it will work in the oldest browsers and node versions that you need to support.
1$ npm install --save eventemitter3
Recommended CDN:
1https://unpkg.com/eventemitter3@latest/dist/eventemitter3.umd.min.js
After installation the only thing you need to do is require the module:
1var EventEmitter = require('eventemitter3');
And you're ready to create your own EventEmitter instances. For the API documentation, please follow the official Node.js documentation:
http://nodejs.org/api/events.html
We've upgraded the API of the EventEmitter.on
, EventEmitter.once
and
EventEmitter.removeListener
to accept an extra argument which is the context
or this
value that should be set for the emitted events. This means you no
longer have the overhead of an event that required fn.bind
in order to get a
custom this
value.
1var EE = new EventEmitter()
2 , context = { foo: 'bar' };
3
4function emitted() {
5 console.log(this === context); // true
6}
7
8EE.once('event-name', emitted, context);
9EE.on('another-event', emitted, context);
10EE.removeListener('another-event', emitted, context);
This module is well tested. You can run:
npm test
to run the tests under Node.js.npm run test-browser
to run the tests in real browsers via Sauce Labs.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
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no vulnerabilities detected
Reason
dependency not pinned by hash detected -- score normalized to 7
Details
Reason
3 commit(s) out of 30 and 0 issue activity out of 30 found in the last 90 days -- score normalized to 2
Reason
GitHub code reviews found for 3 commits out of the last 30 -- score normalized to 1
Details
Reason
no badge detected
Reason
non read-only tokens detected in GitHub workflows
Details
Reason
no update tool detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Reason
security policy file not detected
Score
Last Scanned on 2022-08-15
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More