runClifunction
Run the command line. See kotoba --help for what it takes.
Import it
import { runCli } from "@johnmorrisdotca/kotoba/cli";
Definition
function runCli(args: readonly string[], around?: CliSurroundings): Promise<CliResult>
Parameters
| Name | Type | Description |
|---|---|---|
args | readonly string[] | Command-line arguments without the executable name. |
around (optional) | CliSurroundings | Optional stdin, language environment and other CLI surroundings. |
Returns
Promise<CliResult>
Output and error strings with exit code 0 for success, 1 for refused input or 2 for invalid command usage.
Examples
import { runCli } from "@johnmorrisdotca/kotoba/cli";
console.log((await runCli(["mark","apple","alley"])).code);0What it prints (run when this page was built)