Skip to main content

Function: dataProductHasVersion()

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

Defined in: data-products.ts:238

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

Parameters​

ParameterType
directorystring

Returns​

Function

Parameters​

ParameterType
idstring
version?string

Returns​

Promise<boolean>

Example​

import utils from '@eventcatalog/utils';

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

// returns true if version is found for the given data product and version (supports semver)
await dataProductHasVersion('CustomerDataProduct', '0.0.1');
await dataProductHasVersion('CustomerDataProduct', 'latest');
await dataProductHasVersion('CustomerDataProduct', '0.0.x');