Reference · Cube engine and views
CliSurroundingstype
What the command line is told about where it runs. All of it may be left out.
Import it
import type { CliSurroundings } from "@johnmorrisdotca/kyuubu";
Definition
type CliSurroundings = {
env?: Readonly<Record<string, string | undefined>>;
stdin?: string;
colour?: boolean;
locale?: string;
random?: () => number;
};
Members
| Name | Type | Description |
|---|---|---|
env (optional) | Readonly<Record<string, string | undefined>> | undefined | The environment: |
stdin (optional) | string | undefined | What was piped in, for |
colour (optional) | boolean | undefined | Whether standard output is a terminal that shows colour. Piped output is never coloured. |
locale (optional) | string | undefined | The system's language, used where the environment names none (Windows). |
random (optional) | (() => number) | undefined | Where unseeded scrambles come from: a number in [0, 1), |
Examples
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);enWhat it prints (run when this page was built)