mirror of
https://github.com/denoland/deno.git
synced 2024-11-26 16:09:27 -05:00
45c49034a7
- "SpawnOutput" extends "ChildStatus" instead of composing it - "SpawnOutput::stdout", "SpawnOutput::stderr", "Child::stdin", "Child::stdout" and "Child::stderr" are no longer optional, instead made them getters that throw at runtime if that stream wasn't set to "piped". - Remove the complicated "<T extends SpawnOptions = SpawnOptions>" which we currently need to give proper type hints for the availability of these fields. Their typings for these would get increasingly complex if it became dependent on more options (e.g. "SpawnOptions::pty" which if set should make the stdio streams unavailable)
12 lines
199 B
TypeScript
12 lines
199 B
TypeScript
try {
|
|
await Deno.spawn("ls");
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
|
|
const { success } = await Deno.spawn("curl", {
|
|
args: ["--help"],
|
|
stdout: "null",
|
|
stderr: "inherit",
|
|
});
|
|
console.log(success);
|