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

getService

Callable

  • getService(directory: string): (id: string, version?: string) => Promise<Service>

  • Returns a service from EventCatalog.

    You can optionally specify a version to get a specific version of the service

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

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

    // Gets the latest version of the event
    const service = await getService('InventoryService');

    // Gets a version of the event
    const service = await getService('InventoryService', '0.0.1');