---
title: ExecResult
description: "An exec's phase and, once it has one, its outcome."
---

An exec's phase and, once it has one, its outcome.

`#[napi(object)]` is right for this one: it is a pure result with no closure to protect
— there is no `ExecResult` a caller can construct wrongly, because no function takes one
— so a plain JS object with named fields is the friendlier shape and gives up nothing.

## Properties

### done

```ts
done: boolean;
```

Whether the exec has finished, whichever way.

***

### execId

```ts
execId: string;
```

***

### exitCode?

```ts
optional exitCode?: number;
```

`null` when the child died to a signal rather than exiting.

***

### notes

```ts
notes: string[];
```

Human-readable annotations, one per condition that changes how the output reads
(BIND-7). Empty for a clean result; append them to stderr as they are.

***

### ok

```ts
ok: boolean;
```

Whether the command exited zero. False for a signal death and for a still-running
exec, since neither is a success.

***

### phase

```ts
phase: string;
```

`"running"`, `"exited"`, or `"acked"`.

***

### posixExitCode?

```ts
optional posixExitCode?: number;
```

The exit code a POSIX shell would report (BIND-6): 124 when a deadline ended the
command (the daemon's, or `runToCompletion`'s client deadline), 128 plus the signal
for any other signal death, otherwise `exitCode`. `null` only for a running exec.

***

### signal?

```ts
optional signal?: number;
```

The signal that killed the child, when one did.

***

### stderr

```ts
stderr: string;
```

***

### stdout

```ts
stdout: string;
```

***

### synthesized

```ts
synthesized: boolean;
```

True when `runToCompletion` synthesized this result because nothing came back after
its client-deadline kill (BIND-10): `posixExitCode` is 124 and the output is unknown.

***

### timedOut

```ts
timedOut: boolean;
```

True when the daemon execution deadline expired, distinct from cancellation.

***

### truncated

```ts
truncated: boolean;
```

Set when either stream hit the output cap and was cut. A flag rather than a sentinel
inside the bytes, which would be indistinguishable from output containing it.

***

### writersMayBeAlive

```ts
writersMayBeAlive: boolean;
```

Set when the post-exit linger deadline expired with the pipes still open: some
grandchild is alive and may write more that nobody will see.

## Provenance

This page is generated from `bindings/microvms-js/index.d.ts` by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run dts`. `mise run dts:check` fails when the committed file no longer matches the source.