Skip to main content

rmEntityById

Callable

  • rmEntityById(directory: string): (id: string, version?: string, persistFiles?: boolean) => Promise<void>

  • Delete an entity by its id.

    Optionally specify a version to delete a specific version of the entity.

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

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

    // deletes the latest User entity
    await rmEntityById('User');

    // deletes a specific version of the User entity
    await rmEntityById('User', '0.0.1');