Skip to main content
View as Markdown

Function: rmDiagramById()

rmDiagramById(directory): (id, version?, persistFiles?) => Promise<void>

Defined in: diagrams.ts:163

Delete a diagram by its id.

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

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
idstring
version?string
persistFiles?boolean

Returns

Promise<void>

Example

import utils from '@eventcatalog/utils';

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

// deletes the latest ArchitectureDiagram diagram
await rmDiagramById('ArchitectureDiagram');

// deletes a specific version of the ArchitectureDiagram diagram
await rmDiagramById('ArchitectureDiagram', '0.0.1');