Skip to main content

Function: getExamplesFromCommand()

getExamplesFromCommand(directory): (id, version?) => Promise<object[]>

Defined in: commands.ts:352

Get all examples from a command.

Parameters​

ParameterType
directorystring

Returns​

Function

Parameters​

ParameterType
idstring
version?string

Returns​

Promise<object[]>

Example​

import utils from '@eventcatalog/utils';

const { getExamplesFromCommand } = utils('/path/to/eventcatalog');

const examples = await getExamplesFromCommand('UpdateInventory');
const examples = await getExamplesFromCommand('UpdateInventory', '0.0.1');