Skip to main content

Function: channelHasVersion()

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

Defined in: channels.ts:197

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

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
idstring
version?string

Returns

Promise<boolean>

Example

import utils from '@eventcatalog/utils';

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

// returns true if version is found for the given event and version (supports semver)
await channelHasVersion('inventory.{env}.events', '0.0.1');
await channelHasVersion('inventory.{env}.events', 'latest');
await channelHasVersion('inventory.{env}.events', '0.0.x');*