CliSurroundings型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What the command line is told about where it runs. All of it may be left out.
インポート
import type { CliSurroundings } from "@johnmorrisdotca/kyuubu";
定義
type CliSurroundings = {
env?: Readonly<Record<string, string | undefined>>;
stdin?: string;
colour?: boolean;
locale?: string;
random?: () => number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
env (省略可) | Readonly<Record<string, string | undefined>> | undefined | The environment: |
stdin (省略可) | string | undefined | What was piped in, for |
colour (省略可) | boolean | undefined | Whether standard output is a terminal that shows colour. Piped output is never coloured. |
locale (省略可) | string | undefined | The system's language, used where the environment names none (Windows). |
random (省略可) | (() => number) | undefined | Where unseeded scrambles come from: a number in [0, 1), |
例
import type { CliSurroundings } from "@johnmorrisdotca/kyuubu";
import { seededRandom } from "@johnmorrisdotca/kyuubu";
const value: CliSurroundings = { env: {}, locale: "en", colour: false, random: seededRandom("docs") };
console.log(value.locale);en出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。