New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tryghost/domain-events

Package Overview
Dependencies
Maintainers
29
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryghost/domain-events

Lightweight domain event bus for publishing and subscribing to application-level events.

latest
Source
npmnpm
Version
3.0.3
Version published
Weekly downloads
8.6K
111.97%
Maintainers
29
Weekly downloads
 
Created
Source

Domain Events

Purpose

Lightweight domain event bus for publishing and subscribing to application-level events.

Usage

const DomainEvents = require('@tryghost/domain-events');

class MyEvent {
    constructor(message) {
        this.timestamp = new Date();
        this.data = {
            message
        };
    }
}

DomainEvents.subscribe(MyEvent, function handler(event) {
    console.log(event.data.message);
});

const event = new MyEvent('hello world');

DomainEvents.dispatch(event);

FAQs

Package last updated on 16 Mar 2026

Did you know?

Socket

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.

Install

Related posts