Skip to main content

executeCommandWithStream

plugin.terminal.executeCommandWithStream(command: string, executeInMain: boolean): CustomEventEmitter

Executes a given command and streams the output. Listens for messages from the WebSocket and streams the output data.

Parameters

ParameterTypeRequiredDescription
commandstringYesThe command to be executed.
executeInMainbooleanYes(default: false)

Returns

CustomEventEmitter — A promise that streams the output data during command execution.

Example

import plugin from '@codebolt/plugin-sdk';

const result = await plugin.terminal.executeCommandWithStream('command', true);
console.log(result);