Copy as Markdown[View as Markdown](/docs/sdk/functions/rmDiagram.md)

***

# Function: rmDiagram()

> **rmDiagram**(`directory`): (`path`) => `Promise`<`void`>

Defined in: diagrams.ts:140

Delete a diagram at its given path.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter   | Type     |
| ----------- | -------- |
| `directory` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter | Type     |
| --------- | -------- |
| `path`    | `string` |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`void`>

## Example[​](#example "Direct link to Example")

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

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

// removes a diagram at the given path (diagrams dir is appended to the given path)
// Removes the diagram at diagrams/ArchitectureDiagram
await rmDiagram('/ArchitectureDiagram');
```
