Skip to main content
Version: v0.0.3

Function: run()

run(argv, deps): Promise<RunResult>

Run a full cosyte invocation as data.

Parameters

argv

string[]

The arguments after the program name (i.e. process.argv.slice(2)).

deps

RunDeps

Injected input readers (RunDeps).

Returns

Promise<RunResult>

The RunResult to write to the process streams and exit with.

Example

import { run } from "@cosyte/cli";

const deps = { readFile: async () => new Uint8Array(), readStdin: async () => new Uint8Array() };
const { exit } = await run(["--version"], deps);
exit; // => 0