Skip to main content

getChannel

Callable

  • getChannel(directory: string): (id: string, version?: string) => Promise<Channel>

  • Returns a channel from EventCatalog.

    You can optionally specify a version to get a specific version of the channel

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

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

    // Gets the latest version of the channel
    const channel = await getChannel('InventoryChannel');

    // Gets a version of the channel
    const channel = await getChannel('InventoryChannel', '0.0.1');