Function: getService()
getService(
directory): (id,version?) =>Promise<Service>
Defined in: services.ts:37
Returns a service from EventCatalog.
You can optionally specify a version to get a specific version of the service
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
id | string |
version? | string |
Returns
Promise<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');