method ProcessEnumerable.prototype.status
ProcessEnumerable.prototype.status(): Promise<Deno.CommandStatus>

Process exit status.

Important: This is a property that returns a Promise, not a method. Use await p.status not await p.status().

The Promise resolves when the process exits. You should consume the process output before or concurrently with checking status to avoid resource leaks.

Examples

Check exit code

const p = run("some-command");
await p.lines.collect(); // Consume output first
const status = await p.status; // Property, not method
if (status.code !== 0) {
  console.error(`Failed with code ${status.code}`);
}

Return Type

Usage

import { ProcessEnumerable } from ".";