
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
Emiteer is a lightweight and flexible event emitter library for JavaScript and TypeScript. It allows you to manage events and event listeners in your applications with ease.
You can install Emiteer via npm:
npm install emiteer
First, import Emiteer in your JavaScript or TypeScript file:
import Emiteer from 'emiteer'
Then, create an instance of Emiteer:
const emiteer = new Emiteer()
You can add event listeners using the on method:
const subscriptionToken = emiteer.on('eventName', (payload, eventName) => {
console.log(`Received event: ${eventName}, Payload:`, payload)
})
Another Example:
function logPayload(payload) {
console.log(`Logging payload: ${payload}`)
}
emiteer.on('payload:show', logPayload)
You can also subscribe to an event that will be triggered only once using the once method:
const onceToken = emiteer.once('eventNameOnce', (payload, eventName) => {
console.log(`Received event once: ${eventName}, Payload:`, payload)
})
You can emit events using the emit method:
emiteer.emit('eventName', { message: 'Hello, Emiteer!' })
Another example:
function logPayload(payload) {
console.log(`Logging payload: ${payload}`)
}
emiteer.on('payload:show', logPayload)
// ------------- another file, component, fn
const payload = { foo: 'bar' }
emiteer.emit('payload:show', payload)
// "Logging payload: {foo: bar}"
To remove event listeners, you can use the off method:
emiteer.off('eventName', subscriptionToken)
destroyAllHandlers: Clears all event handlers.destroyAllHandlersForEvent(event: string): Clears event handlers for a specific event.getSubscribers: Retrieves a copy of all subscribers mapped by event name.getSubscribersByName(event: string): Retrieves a copy of subscribers for a specific event.hasSubscriber(event: string, token?: string): Checks if a subscriber exists for an event.hasSubscribers(event?: string | null): Checks if any subscribers exist.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
JavaScript event emitter built in TypeScript
We found that emiteer 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
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.