Skip to content

@loontail/minecraft-kit v0.8.14 / SpawnedProcess

Type alias: SpawnedProcess

ts
type SpawnedProcess: {
  exited: Promise<{
     code: number | null;
     signal: NodeJS.Signals | null;
    }>;
  pid: number;
  stderr: ProcessStream;
  stdout: ProcessStream;
  kill: boolean;
};

Live handle for a child process.

Example

ts
import type { SpawnedProcess } from "@loontail/minecraft-kit";

const proc: SpawnedProcess = mySpawner.spawn("java", ["-version"], { cwd: process.cwd() });
proc.stderr.on("data", (line) => console.log(line));
const exit = await proc.exited;
console.log("exit code:", exit.code);

Type declaration

MemberTypeDescription
exitedPromise<{
code: number | null;
signal: NodeJS.Signals | null;
}>Resolves when the process exits with its exit info.
pidnumber-
stderrProcessStream-
stdoutProcessStream-
killbooleanSend a termination signal. Returns true on success.

Source

src/types/spawner.ts:32

MIT License