
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
event-register
Advanced tools
A simple browser based custom DOM event proxy with debugging tools and repeat addEventListener protection. It uses an Event Registry to ensure non-duplicate listeners.
npm i -S event-register
Event-register's import returns a Singleton Class so you can access the same register no matter where in your application you import/instantiate it.
import eventRegister from 'event-register';
This is how you fire events through the proxy.
erMeta property exists in the payload, then it will be extracted and added to event.data.meta and it will be removed from the payload itself. This is for advanced use where data may need to be passed through the payload, but it's less than ideal to have it in the payload itself. eventRegister.publish(
'myCustomEvent',
{
someDataKey: 'my data',
erMeta: { 'someMetaData':true}
}
);
This is how you listen to events coming through the proxy. You can add as many subscribe handlers as you want, it won't duplicate event listeners on the DOM.
data.payload property on the event.data property contains your original data.event.data.iderMeta property was passed in the payload then the event will define a meta property on event.data.meta and erMeta will be deleted from the payload. This is a convenience passthrough. eventRegister
.subscribe('myCustomEvent', event => {
console.log('Got the event!', event);
const payload = event.data.payload; // this is the data you sent through the publish function
const meta = event.data.meta;
const eventId = event.data.uuid.
}, true);
There is a utility debug function on the eventRegister instance that allows you monitor events as they happen. When you call it you can pass it no arguments, a single string name for the event you'd like to watch, or an array of event string names.
When calling .debug, the debug function will output the events to the console using console.log;
eventRegister.debug('myCustomEvent');
eventRegister.debug(['myCustomEvent','myCustomEvent1','myCustomEvent2']);
eventRegister.debug();// Monitors all events
the eventRegister.getHistory() function will return the entire event history for your session. Think of this as an Event Store. It gets cleared on page unload and at the moment doesn't persist.
console.log(eventRegister.getHistory());
FAQs
A simple browser based custom DOM event proxy with debugging tools and repeat addEventListener protection. It uses an Event Registry to ensure non-duplicate listeners.
We found that event-register 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.