Skip to main content

Function: getDomain()

getDomain(directory): (id, version?) => Promise<Domain>

Defined in: domains.ts:36

Returns a domain from EventCatalog.

You can optionally specify a version to get a specific version of the domain

Parameters​

ParameterType
directorystring

Returns​

Function

Parameters​

ParameterType
idstring
version?string

Returns​

Promise<Domain>

Example​

import utils from '@eventcatalog/utils';

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

// Gets the latest version of the domain
const domain = await getDomain('Payment');

// Gets a version of the domain
const domain = await getDomain('Payment', '0.0.1');