@jarkkojs/readseek-api
v0.13.16
Published
Shared ReadSeek CLI contract, validation, argv builders, and bounded process runners
Maintainers
Readme
@jarkkojs/readseek-api
TypeScript API for building and validating ReadSeek commands and running them with bounded subprocess output. Supports Node.js 20 or later and Bun.
Install
npm install @jarkkojs/readseek-apiThe API depends on the CLI package, which installs the platform binary.
Usage
import {
buildTreeArgs,
resolveReadSeekBinaryFromPackages,
resolveReadSeekBinaryOverride,
runReadSeekNodeKdl,
} from "@jarkkojs/readseek-api";
const binary =
resolveReadSeekBinaryOverride() ?? resolveReadSeekBinaryFromPackages();
const args = buildTreeArgs({ path: "src/index.ts", depth: 2 });
const result = await runReadSeekNodeKdl(binary, args);See the public exports for the API and readseek(1) for command and selector semantics. The process helpers distinguish syntax and rule findings (exit 1) from command failures (exit 2) for those checks.
Use presentShowResult() or formatShowResult() to render show, tree,
meta, and assets results without changing the decoded result.
For whole-file writes, FileSnapshot.capture(path) records the target’s
identity and bytes, or its absence. snapshot.write(text) creates missing
targets exclusively and rejects symbolic links or stale snapshots. It returns
false for unchanged bytes. The check and overwrite are not an atomic
transaction; writers that race after the check still need external
coordination.
License
Licensed under Apache-2.0.
