Status: CONCEPT Β· Created March 2026
Parent: GLOBAL_concept-ecosystem.md
Overview
Event system β the foundation for all @xpulse/* packages. Zero dependencies.
Extends Node's native EventEmitter with optional registration and introspection β
so that events in the ecosystem are documented and traceable.
Concept
Events can optionally be registered β this is not required, but a convention.
An emit() on an unregistered event works, but does not appear in event.list().
Based on Node's EventEmitter β no custom event loop, no queues, no persistence.
Fired and forgotten. The registration map is a simple Map<name, metadata> on top.
// Limit set to 50 β many packages legitimately listen to the same events in the ecosystem
7
emitter.setMaxListeners(50);
Dependencies
None.
Debug Integration
When @xpulse/debug is installed as a devDependency, @xpulse/event
automatically provides a DataCollector. @xpulse/debug discovers it via
node_modules/@xpulse/event/src/datacollectors/ β no configuration needed.
1
"optionalDependencies":{
2
"@xpulse/debug":"^1.0.0"
3
}
The EventsCollector (name: 'events', icon: 'β‘') shows in the Web Profiler:
Registered Events (table): all events known via event.register() with
name, emitted by, active listener count, description
Emitted During Request (table): all events actually fired during
this request with name, timestamp, and truncated payload
Strategy: The EventsCollector wraps event.emit directly instead of
registering a separate listener for each event. This means events are also
captured that were never registered via event.register() (e.g. template:render:after).
Excluded are http:response:before (circular payload) and logger:write
(too many entries).
Badge in the toolbar: number of events emitted during the request (e.g. 7)
Open Questions
Question
Status
event.listAll() also for unregistered (but active) events?