runProcess()
Run a Node child process and emit the buffered result once.
Import
Section titled “Import”import { runProcess } from "@graphrefly/ts/sources/node";Signature
Section titled “Signature”function runProcess( cmd: string, args: readonly string[] = [], opts: FromSpawnOptions = {},): Operator<never, ProcessResult>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
cmd | string | Executable name or path. |
args | readonly string[] | Command-line arguments. |
opts | FromSpawnOptions | Optional cwd, env, shell, signal, stdio, and kill grace settings. |
Returns
Section titled “Returns”A source operator that emits one process result and then COMPLETE.
Example
Section titled “Example”import { graph } from "@graphrefly/ts/graph";import { runProcess } from "@graphrefly/ts/sources/node";
const status = graph().initNode(runProcess("git", ["status"]), []);Source
Section titled “Source”packages/ts/src/sources/node.ts