Skip to content
PACKAGES

runProcess()

Run a Node child process and emit the buffered result once.

import { runProcess } from "@graphrefly/ts/sources/node";
function runProcess(
cmd: string,
args: readonly string[] = [],
opts: FromSpawnOptions = {},
): Operator<never, ProcessResult>
ParameterTypeDescription
cmdstringExecutable name or path.
argsreadonly string[]Command-line arguments.
optsFromSpawnOptionsOptional cwd, env, shell, signal, stdio, and kill grace settings.

A source operator that emits one process result and then COMPLETE.

import { graph } from "@graphrefly/ts/graph";
import { runProcess } from "@graphrefly/ts/sources/node";
const status = graph().initNode(runProcess("git", ["status"]), []);

packages/ts/src/sources/node.ts