You can optionally override the path of the command.
@example
import utils from'@eventcatalog/utils'; const{ writeCommand }=utils('/path/to/eventcatalog'); // Write a command to the catalog // Command would be written to commands/UpdateInventory awaitwriteCommand({ id:'UpdateInventory', name:'Update Inventory', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', }); // Write a command to the catalog but override the path // Command would be written to commands/Inventory/UpdateInventory awaitwriteCommand({ id:'UpdateInventory', name:'Update Inventory', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ path:"/Inventory/UpdateInventory"}); // Write a command to the catalog and override the existing content (if there is any) awaitwriteCommand({ id:'UpdateInventory', name:'Update Inventory', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ override:true}); // Write a command to the catalog and version the previous version // only works if the new version is greater than the previous version awaitwriteCommand({ id:'UpdateInventory', name:'Update Inventory', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ versionExistingContent:true});
Write a command to EventCatalog.
You can optionally override the path of the command.