The one allowed subprocess spawn point — every external-tool invocation routes through this capability.
Nothing in prx calls node:child_process directly. They go through a
CommandRunner, so spawning is policy-checked (via @bounded-systems/policy),
capturable, and substitutable in tests. The result is that the set of external
commands a program can run is enumerable and gated, not scattered.
npm install @bounded-systems/proc @bounded-systems/env @bounded-systems/policy zodzod is a peer dependency (^3.25 || ^4).
import {
defaultRunner,
runCaptured,
type CommandRunner,
type CommandResult,
type RunOptions,
} from "@bounded-systems/proc";
// Depend on the runner port; default to the real one.
async function gitStatus(run: CommandRunner = defaultRunner) {
const res: CommandResult = await runCaptured(run, "git", ["status", "--porcelain"]);
return res.stdout;
}- Single spawn point. All subprocess execution flows through a
CommandRunner, so it can be policy-gated and mocked.node:child_processlives here and nowhere else. - Policy-aware. Cacheability and read-only classification derive from
@bounded-systems/policy. An extractability test enforces thatenvandpolicyare the only repo dependencies.
MIT © Bounded Systems