Function: getCommands()
getCommands(
directory): (options?) =>Promise<Command[]>
Defined in: commands.ts:64
Returns all commands 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<Command[]>
Example
import utils from '@eventcatalog/utils';
const { getCommands } = utils('/path/to/eventcatalog');
// Gets all commands (and versions) from the catalog
const commands = await getCommands();
// Gets all commands (only latest version) from the catalog
const commands = await getCommands({ latestOnly: true });
// Gets all commands with the schema attached
const commands = await getCommands({ attachSchema: true });