
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
secret-event-listener
Advanced tools
Add an event listener without causing any side effects.
Adding an event listener to an emitter object will normally trigger
certain side effects. E.g. the
newListener
event will be emitted for every new listener added. A
MaxListenersExceededWarning process warning will be emitted if the
emitter reaches is maximum listener
count.
Or a readable stream will enter flowing
mode if a data
listener is added.
This module gives you the ability to attach a listener without triggering any of these side effects.
Only use this module if you are sure you don't want any side effects and there's other way to achieve your goals!
npm install secret-event-listener --save
const {EventEmitter} = require('events')
const addSecretListener = require('secret-event-listener')
const emitter = new EventEmitter()
emitter.on('newListener', function () {
throw new Error('should not fire the newListener event!')
})
addSecretListener(emitter, 'foo', function () {
console.log('foo event fired :)')
})
emitter.emit('foo')
addSecretListener(emitter, eventName, listener)Arguments:
emitter - an object inheriting from
EventEmittereventName - the event to add the listener tolistener - a listener function which should be called every time an
event of eventName is emitted.addSecretListener.prepend(emitter, eventName, listener)Like the main addSecretListener function, except the listener is
added to the beginning of the listeners array for the event named
eventName.
FAQs
Add an event listener without causing any side effects
We found that secret-event-listener demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.