Skip to main content

Function: serviceHasVersion()

serviceHasVersion(directory): (id, version?) => Promise<boolean>

Defined in: services.ts:449

Check to see if the catalog has a version for the given service.

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
idstring
version?string

Returns

Promise<boolean>

Example

import utils from '@eventcatalog/utils';

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

// returns true if version is found for the given event and version (supports semver)
await serviceHasVersion('InventoryService', '0.0.1');
await serviceHasVersion('InventoryService', 'latest');
await serviceHasVersion('InventoryService', '0.0.x');*