Skip to the content

Kotoba言葉

Load only the word lists you need, mark repeated letters correctly and play a daily or seeded word game.

Kotoba is the Japanese word for words. About the name

Contents

Reference · Command line

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

NameTypeDescription
argsreadonly 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);
0

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kotoba 1.2.0.