Function: addExampleToEvent()
addExampleToEvent(
directory): (id,example,version?) =>Promise<void>
Defined in: events.ts:335
Add an example file to an event.
Parameters​
| Parameter | Type |
|---|---|
directory | string |
Returns​
Function
Parameters​
| Parameter | Type |
|---|---|
id | string |
example | { content: string; fileName: string; } |
example.content | string |
example.fileName? | string |
version? | string |
Returns​
Promise<void>
Example​
import utils from '@eventcatalog/utils';
const { addExampleToEvent } = utils('/path/to/eventcatalog');
await addExampleToEvent('InventoryAdjusted', { content: '{"id": "123"}', fileName: 'basic.json' });
await addExampleToEvent('InventoryAdjusted', { content: '{"id": "123"}', fileName: 'basic.json' }, '0.0.1');