Reference · Rolls and exact odds
CliResulttype
What the command line came to.
Import it
import type { CliResult } from "@johnmorrisdotca/korokoro";
Definition
type CliResult = {
code: 0 | 1 | 2;
out: string;
err: string;
};
Members
| Name | Type | Description |
|---|---|---|
code | 0 | 1 | 2 | 0 when all went well, 1 when something asked for could not be rolled, 2 when the command itself was wrong. |
out | string | For standard output. |
err | string | For standard error. |
Examples
import type { CliResult } from "@johnmorrisdotca/korokoro";
import { runCli } from "@johnmorrisdotca/korokoro";
const value: CliResult = runCli(["2d6", "--seed", "docs"]);
console.log(value.code);0What it prints (run when this page was built)