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

***

# Function: getServices()

> **getServices**(`directory`): (`options`?) => `Promise`<`Service`\[]>

Defined in: services.ts:78

Returns all services from EventCatalog.

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

## 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`<`Service`\[]>

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

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

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

// Gets all services (and versions) from the catalog
const services = await getServices();

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