This page covers command execution in BoxLite — the JsExecution handle, stdin/stdout/stderr streams, and the ExecResult wrapper type.
JsExecution
Handle for a running command. Returned by JsBox.exec().
Methods
Example
Streams
JsExecStdin
Writer for sending input to a running process.
JsExecStdout / JsExecStderr
Readers for streaming output.
Each stream can only be consumed once. After iterating to EOF, subsequent calls return null.
Reading stderr
JsExecResult
Result of a completed execution. Returned by JsExecution.wait().
ExecResult (wrapper)
Higher-level result type returned by SimpleBox.exec(). This wraps the low-level JsExecResult with captured stdout and stderr.
Example
Handling non-zero exit codes
Full Execution Lifecycle
Here is a complete example showing the full lifecycle of a command execution using the low-level API: