Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@hypernym/emitter
Advanced tools
A super simple and lightweight event emitter.
Repository | Package | Releases | Discussions
npm i @hypernym/emitter
import { createEmitter } from '@hypernym/emitter'
const emitter = createEmitter()
emitter.on('event-id', (e) => console.log(e.x, e.y))
emitter.emit('event-id', { x: 0, y: 0 })
import { createEmitter, type Emitter } from '@hypernym/emitter'
type Events = {
'event-id': { x: number; y: number }
// ...
}
const emitter: Emitter<Events> = createEmitter<Events>()
emitter.on('event-id', (e) => console.log(e.x, e.y))
emitter.emit('event-id', { x: 0, y: 0 })
Registers a specific event.
emitter.on(id: string, callback: (event: any) => void)
Emits a specific event.
emitter.emit(id: string, event: any)
Main events map.
Stores all registered events.
emitter.events
Checks if a specific event by id
exists in the map.
emitter.events.has(id: string)
Gets a specific event by id
from the map.
emitter.events.get(id: string)
Deletes a specific event by id
from the map.
emitter.events.delete(id: string)
Removes all events from the map.
emitter.events.clear()
Feel free to use the official discussions for any additional questions.
Developed in 🇭🇷 Croatia
Released under the MIT license.
© Hypernym Studio
FAQs
A super simple and lightweight event emitter.
We found that @hypernym/emitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.