Skip to main content

dataStoreHasVersion

Callable

  • dataStoreHasVersion(directory: string): (id: string, version?: string) => Promise<boolean>

  • Check to see if the catalog has a version for the given data store (e.g. database, cache, etc.).

    @example
    import utils from '@eventcatalog/utils';

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

    // returns true if version is found for the given data store and version (supports semver)
    await dataStoreHasVersion('orders-db', '0.0.1');
    await dataStoreHasVersion('orders-db', 'latest');
    await dataStoreHasVersion('orders-db', '0.0.x');