Skip to main content

Function: getChannels()

getChannels(directory): (options?) => Promise<Channel[]>

Defined in: channels.ts:52

Returns all channels from EventCatalog.

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

Parameters

ParameterType
directorystring

Returns

Function

Parameters

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

Returns

Promise<Channel[]>

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