Skip to main content

Function: getServiceByPath()

getServiceByPath(directory): (path) => Promise<Service>

Defined in: services.ts:54

Returns a service from EventCatalog by it's path.

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
pathstring

Returns

Promise<Service>

Example

import utils from '@eventcatalog/utils';

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

// Returns a service from the catalog by it's path
const service = await getServiceByPath('/services/InventoryService/index.mdx');