Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 1, 2024 via pnpm

eventemitter2 6.4.9

A feature-rich Node.js event emitter implementation with namespaces, wildcards, TTL, async listeners and browser/worker support.
Package summary
Share
0
issues
1
license
1
MIT
Package created
1 Jun 2011
Version published
12 Sep 2022
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
eventemitter2@6.4.9
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of eventemitter2 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does eventemitter2 do?

EventEmitter2 is an advanced event emitter implementation for Node.js. It has remarkable features such as namespaces, wildcards, times to listen (TTL), asynchronous listeners, and more. EventEmitter2 is fully compatible with Node.js and browsers or workers of any kind and is enriched with non-breaking features thus improving the standard EventEmitter module.

How do you use eventemitter2?

To use EventEmitter2, first install it in your Node.js project via npm:

$ npm install eventemitter2

Import it into your JavaScript file:

const EventEmitter2 = require('eventemitter2');

Then create a new instance of EventEmitter2:

var emitter = new EventEmitter2({
  wildcard: true,
  delimiter: '.',
  newListener: false,
  removeListener: false,
  maxListeners: 10,
  verboseMemoryLeak: false,
  ignoreErrors: false
});

To listen for an event, use the on method:

emitter.on('foo', function(data) {
  console.log('An event occurred!', data);
});

To emit an event, use the emit method:

emitter.emit('foo', { some: 'data' });

Events can be emitted and listened multiple times or only once, and have support for namespaces and wildcards.

Where are the eventemitter2 docs?

The complete documentation of EventEmitter2 is available on its official Github repository.