API Reference
runProcess()
Run a Node child process and emit the buffered result once.
Import
import { runProcess } from "@graphrefly/ts/sources/node";
Signature
function runProcess(
cmd: string,
args: readonly string[] = [],
opts: FromSpawnOptions = {},
): Operator<never, ProcessResult>
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
A source operator that emits one process result and then COMPLETE.
Example
import { graph } from "@graphrefly/ts/graph";
import { runProcess } from "@graphrefly/ts/sources/node";
const status = graph().initNode(runProcess("git", ["status"]), []);
Source
packages/ts/src/sources/node.ts