GraphReFlyTS

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

ParameterTypeDescription
cmdstringExecutable name or path.
argsreadonly string[]Command-line arguments.
optsFromSpawnOptionsOptional 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