Skip to main content

getChannels

Callable

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

  • Returns all channels from EventCatalog.

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

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

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

    // Gets all channels (and versions) from the catalog
    const channels = await getChannels();

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