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

***

# Function: getDataStores()

> **getDataStores**(`directory`): (`options`?) => `Promise`<`Container`\[]>

Defined in: data-stores.ts:43

Returns all data stores (e.g. databases, caches, etc.) from EventCatalog.

You can optionally specify if you want to get the latest version of the data stores.

## 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                         |
| --------------------- | ---------------------------- |
| `options`?            | { `latestOnly`: `boolean`; } |
| `options.latestOnly`? | `boolean`                    |

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

`Promise`<`Container`\[]>

## Examples[​](#examples "Direct link to Examples")

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

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

// Gets all data stores (and versions) from the catalog
const containers = await getDataStores();

// Gets all data stores (only latest version) from the catalog
const containers = await getDataStores({ latestOnly: true });
```

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

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

// Gets all containers (and versions) from the catalog
const containers = await getContainers();

// Gets all entities (only latest version) from the catalog
const containers = await getContainers({ latestOnly: true });
```
