Skip to main content

getEntities

Callable

  • getEntities(directory: string): (options?: { latestOnly?: boolean }) => Promise<Entity[]>

  • Returns all entities from EventCatalog.

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

    @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 });