CliSurroundingstype
What the command line is run in. All of it is optional.
Import it
import type { CliSurroundings } from "@johnmorrisdotca/toranpu";
Definition
type CliSurroundings = {
env?: Record<string, string | undefined>;
stdin?: string;
readFile?: (path: string) => string | null;
colour?: boolean;
locale?: string;
seed?: () => number;
};
Members
| Name | Type | Description |
|---|---|---|
env (optional) | Record<string, string | undefined> | undefined | The environment, for the language ( |
stdin (optional) | string | undefined | Standard input, when |
readFile (optional) | ((path: string) => string | null) | undefined | Reads a file named on the command line, or gives null when it cannot be read. |
colour (optional) | boolean | undefined | Whether the output is a terminal that shows colour. |
locale (optional) | string | undefined | The system's language where the environment names none: what |
seed (optional) | (() => number) | undefined | Where a seed comes from when none is given: a function that returns a whole number from 1. |
Examples
import type { CliSurroundings } from "@johnmorrisdotca/toranpu";
const value: CliSurroundings = { env: {}, locale: "en", colour: false, seed: () => 42 };
console.log(value.locale);enWhat it prints (run when this page was built)