Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/xdg/vendor/types/deno.d.ts>Deno.Process#status

Determine XDG Base Directory paths (OS/platform portable)
Go to Latest
method Deno.Process.prototype.status
import { Deno } from "https://deno.land/x/xdg@v10.3.0/vendor/types/deno.d.ts";
const { Process } = Deno;

Wait for the process to exit and return its exit status.

Calling this function multiple times will return the same status.

Stdin handle to the process will be closed before waiting to avoid a deadlock.

If stdout and/or stderr were set to "piped", they must be closed manually before the process can exit.

To run process to completion and collect output from both stdout and stderr use:

const p = Deno.run({ cmd, stderr: 'piped', stdout: 'piped' });
const [status, stdout, stderr] = await Promise.all([
  p.status(),
  p.output(),
  p.stderrOutput()
]);
p.close();