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