Skip to main content

writeServiceToDomain

Callable

  • writeServiceToDomain(directory: string): (service: Service, domain: { direction?: string; id: string; version?: string }, options?: { path: string }) => Promise<void>

  • Write a service to a domain in EventCatalog.

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

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

    // Write a service to a domain
    // Service would be written to domains/Shopping/services/InventoryService
    await writeServiceToDomain({
    id: 'InventoryService',
    name: 'Inventory Service',
    version: '0.0.1',
    summary: 'Service that handles the inventory',
    markdown: '# Hello world',
    }, { id: 'Shopping' });