Open PoneyClairDeLune opened 1 year ago
First rough draft.
navigator.child
class {
static? DITCH = 0; // "null"
static? DISCARD = 0;
static? TRASH = 0;
static? NULL = 0;
static? IGNORE = 0;
static? THRU = 1; // "inherit"
static? PASS = 1;
static? THROUGH = 1;
static? PASSTHRU = 1;
static? PASSALONG = 1;
static? PASSTHROUGH = 1;
static? SINK = 2; // "pipe" or "piped"
static? PIPED = 2;
static? STREAM = 2;
static? ACCEPT = 2;
static? PROCESS = 2;
static new(execPath, ?options);
static spawn(execPath, ?options);
static run(execPath, ?options);
static runSync(execPath, ?options);
spawn();
run();
runSync();
}
.new()
/ new navigator.child
Implements a variant of Deno.ChildProcess
.
navigator.child.new(execPath, {
?args: [],
?env: {},
?pure: false, // clearEnv in Deno
?uid: ?0, // no equiv in Bun
?gid: ?0, // no equiv in Bun
?signal: AbortSignal, // no equiv in Bun
?runtimeNativeIPC: true, // no equiv in Deno
?stdin: 2,
?stdout: 2,
?stderr: 1,
?rawWindows: false // no equiv in Bun
});
.spawn()
<- shortcut to Deno.ChildProcess.spawn()
with object creation.runSync()
<- shortcut to Deno.ChildProcess.outputSync()
.run()
<- shortcut to Deno.ChildProcess.output(), encapsulated version of
.runSync()`