Function: getDomains()
getDomains(
directory): (options?) =>Promise<Domain[]>
Defined in: domains.ts:59
Returns all domains from EventCatalog.
You can optionally specify if you want to get the latest version of the domains.
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
options? | { latestOnly: boolean; } |
options.latestOnly? | boolean |
Returns
Promise<Domain[]>
Example
import utils from '@eventcatalog/utils';
const { getDomains } = utils('/path/to/eventcatalog');
// Gets all domains (and versions) from the catalog
const domains = await getDomains();
// Gets all domains (only latest version) from the catalog
const domains = await getDomains({ latestOnly: true });