Function: getEvents()
getEvents(
directory): (options?) =>Promise<Event[]>
Defined in: events.ts:63
Returns all events from EventCatalog.
You can optionally specify if you want to get the latest version of the events.
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
options? | { attachSchema: boolean; latestOnly: boolean; } |
options.attachSchema? | boolean |
options.latestOnly? | boolean |
Returns
Promise<Event[]>
Example
import utils from '@eventcatalog/utils';
const { getEvents } = utils('/path/to/eventcatalog');
// Gets all events (and versions) from the catalog
const events = await getEvents();
// Gets all events (only latest version) from the catalog
const events = await getEvents({ latestOnly: true });
// Get all events with the schema attached
const events = await getEvents({ attachSchema: true });