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

versionCommand

Callable

  • versionCommand(directory: string): (id: string) => Promise<void>

  • Version a command by it's id.

    Takes the latest command and moves it to a versioned directory. All files with this command are also versioned (e.g /commands/UpdateInventory/schema.json)

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

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

    // moves the latest UpdateInventory command to a versioned directory
    // the version within that command is used as the version number.
    await versionCommand('UpdateInventory');