Gathering detailed insights and metrics for component-emitter
Gathering detailed insights and metrics for component-emitter
Gathering detailed insights and metrics for component-emitter
Gathering detailed insights and metrics for component-emitter
npm install component-emitter
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
601 Stars
94 Commits
118 Forks
16 Watchers
3 Branches
22 Contributors
Updated on May 25, 2025
Latest Version
2.0.0
Package Id
component-emitter@2.0.0
Unpacked Size
9.34 kB
Size
2.93 kB
File Count
5
NPM Version
9.2.0
Node Version
20.9.0
Published on
Nov 17, 2023
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
Simple event emitter
1npm install component-emitter
As an Emitter
instance:
1import Emitter from 'component-emitter'; 2 3const emitter = new Emitter(); 4 5emitter.emit('🦄');
As a mixin:
1import Emitter from 'component-emitter'; 2 3const user = {name: 'tobi'}; 4Emitter(user); 5 6user.emit('I am a user');
As a prototype mixin:
1import Emitter from 'component-emitter'; 2 3Emitter(User.prototype);
Create a new emitter.
Use it as a mixin. For example a plain object may become an emitter, or you may extend an existing prototype.
Register an event handler that listens to a specified event.
Register a one-time event handler for a specified event.
Remove a specific event handler for a specified event.
Remove all event handlers for a specified event.
Remove all event handlers for all events.
Emit an event, invoking all handlers registered for it.
Retrieve the event handlers registered for a specific event.
Get the count of listeners for a specific event.
Get the count of all event handlers in total.
Check if there are any handlers registered for a specific event.
Check if there are any handlers registered for any event.
It's simpler and more lightweight, and it works in any JavaScript environment, not just Node.js. It also provides mixin functionality to add event handling to existing objects without needing inheritance.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 5/28 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
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