MCPcopy
hub / github.com/garrytan/gstack / spawn

Function spawn

browse/src/bun-polyfill.cjs:87–104  ·  view source on GitHub ↗
(cmd, options = {})

Source from the content-addressed store, hash-verified

85 },
86
87 spawn(cmd, options = {}) {
88 const [command, ...args] = cmd;
89 const stdio = options.stdio || ['pipe', 'pipe', 'pipe'];
90 const proc = spawn(command, args, {
91 stdio,
92 env: options.env,
93 cwd: options.cwd,
94 });
95
96 return {
97 pid: proc.pid,
98 stdout: proc.stdout,
99 stderr: proc.stderr,
100 stdin: proc.stdin,
101 unref() { proc.unref(); },
102 kill(signal) { proc.kill(signal); },
103 };
104 },
105
106 sleep(ms) {
107 return new Promise((resolve) => setTimeout(resolve, ms));

Callers 15

spawnServerFunction · 0.90
watchdog.test.tsFile · 0.90
spawnGbrainAsyncFunction · 0.85
spawnDaemonForTestFunction · 0.85
openBrowserFunction · 0.85
tryOpenFunction · 0.85
spawnAndWaitReadyFunction · 0.85
listDevicesFunction · 0.85

Calls

no outgoing calls

Tested by 2

spawnServerFunction · 0.72
runCliFunction · 0.68