Skip to main content
New project sponsor 🪝Hookdeck: Serverless infrastructure for event-driven architecture. Learn more.

versionEvent

Callable

  • versionEvent(directory: string): (id: string) => Promise<void>

  • Version an event by it's id.

    Takes the latest event and moves it to a versioned directory. All files with this event are also versioned (e.g /events/InventoryAdjusted/schema.json)

    @example
    import utils from '@eventcatalog/utils';

    const { versionEvent } = utils('/path/to/eventcatalog');

    // moves the latest InventoryAdjusted event to a versioned directory
    // the version within that event is used as the version number.
    await versionEvent('InventoryAdjusted');