Function: addExampleToCommand()
addExampleToCommand(
directory): (id,example,version?) =>Promise<void>
Defined in: commands.ts:336
Add an example file to a command.
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 { addExampleToCommand } = utils('/path/to/eventcatalog');
await addExampleToCommand('UpdateInventory', { content: '{"id": "123"}', fileName: 'basic.json' });
await addExampleToCommand('UpdateInventory', { content: '{"id": "123"}', fileName: 'basic.json' }, '0.0.1');