Skip to main content

Function: getEntities()

getEntities(directory): (options?) => Promise<Entity[]>

Defined in: entities.ts:51

Returns all entities from EventCatalog.

You can optionally specify if you want to get the latest version of the entities.

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
options?{ latestOnly: boolean; }
options.latestOnly?boolean

Returns

Promise<Entity[]>

Example

import utils from '@eventcatalog/utils';

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

// Gets all entities (and versions) from the catalog
const entities = await getEntities();

// Gets all entities (only latest version) from the catalog
const entities = await getEntities({ latestOnly: true });