Skip to main content
New project sponsor 🪝Hookdeck: Serverless infrastructure for event-driven architecture. Learn more.

getCommand

Callable

  • getCommand(directory: string): (id: string, version?: string) => Promise<Command>

  • Returns a command from EventCatalog.

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

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

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

    // Gets the latest version of the command
    const command = await getCommand('UpdateInventory');

    // Gets a version of the command
    const command = await getCommand('UpdateInventory', '0.0.1');