Gathering detailed insights and metrics for event-emitter
Gathering detailed insights and metrics for event-emitter
Gathering detailed insights and metrics for event-emitter
Gathering detailed insights and metrics for event-emitter
npm install event-emitter
Typescript
Module System
Node Version
NPM Version
91.3
Supply Chain
98.3
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
245 Stars
177 Commits
23 Forks
7 Watchers
2 Branches
2 Contributors
Updated on May 03, 2025
Latest Version
0.3.5
Package Id
event-emitter@0.3.5
Size
7.41 kB
NPM Version
4.1.2
Node Version
7.7.3
Published on
Mar 15, 2017
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
$ npm install event-emitter
To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: Browserify, Webmake or Webpack
1var ee = require('event-emitter'); 2 3var MyClass = function () { /* .. */ }; 4ee(MyClass.prototype); // All instances of MyClass will expose event-emitter interface 5 6var emitter = new MyClass(), listener; 7 8emitter.on('test', listener = function (args) { 9 // … react to 'test' event 10}); 11 12emitter.once('test', function (args) { 13 // … react to first 'test' event (invoked only once!) 14}); 15 16emitter.emit('test', arg1, arg2/*…args*/); // Two above listeners invoked 17emitter.emit('test', arg1, arg2/*…args*/); // Only first listener invoked 18 19emitter.off('test', listener); // Removed first listener 20emitter.emit('test', arg1, arg2/*…args*/); // No listeners invoked
Removes all listeners from given event emitter object
Whether object has some listeners attached to the object.
When name
is provided, it checks listeners for specific event name
1var emitter = ee(); 2var hasListeners = require('event-emitter/has-listeners'); 3var listener = function () {}; 4 5hasListeners(emitter); // false 6 7emitter.on('foo', listener); 8hasListeners(emitter); // true 9hasListeners(emitter, 'foo'); // true 10hasListeners(emitter, 'bar'); // false 11 12emitter.off('foo', listener); 13hasListeners(emitter, 'foo'); // false
Pipes all events from source emitter onto target emitter (all events from source emitter will be emitted also on target emitter, but not other way).
Returns pipe object which exposes pipe.close
function. Invoke it to close configured pipe.
It works internally by redefinition of emit
method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument.
Unifies event handling for two objects. Events emitted on emitter1 would be also emitted on emitter2, and other way back.
Non reversible.
1var eeUnify = require('event-emitter/unify'); 2 3var emitter1 = ee(), listener1, listener3; 4var emitter2 = ee(), listener2, listener4; 5 6emitter1.on('test', listener1 = function () { }); 7emitter2.on('test', listener2 = function () { }); 8 9emitter1.emit('test'); // Invoked listener1 10emitter2.emit('test'); // Invoked listener2 11 12var unify = eeUnify(emitter1, emitter2); 13 14emitter1.emit('test'); // Invoked listener1 and listener2 15emitter2.emit('test'); // Invoked listener1 and listener2 16 17emitter1.on('test', listener3 = function () { }); 18emitter2.on('test', listener4 = function () { }); 19 20emitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4 21emitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4
$ npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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