localPlacefunctionfunction localPlace(cwd: string, path: string, os: "darwin" | "linux" | "windows"): LocalPlaceWhere a plain path points: the root of the store it is in (/, or a drive) and the path inside the store, with slashes.
The world of the process (commons anyfs-cli 0004-anyfs-cli-surfaces FR-003): the stores it opens through the openers of the program and of the configuration, one per place for a run; standard input and output as the bytes they are; a plain path as the root of its store and the path inside it; and a small state folder for the bases of two-way syncs and the ledgers of mirrors. A test makes the same world with its own streams and folder.
import { localPlace } from "./world.ts";
localPlace("/srv/fleet", "a/b", "linux"); // { root: "/", inner: "/srv/fleet/a/b" }localPlacefunctionfunction localPlace(cwd: string, path: string, os: "darwin" | "linux" | "windows"): LocalPlaceWhere a plain path points: the root of the store it is in (/, or a drive) and the path inside the store, with slashes.
WorldOptionstypeno test imports ittype WorldOptions = {
readonly env: (name: string) => string | undefined;
readonly cwd: string;
readonly json: boo… (630 characters)type WorldOptions = {
readonly env: (name: string) => string | undefined;
readonly cwd: string;
readonly json: boolean;
readonly config: Config;
/** The folder of the state; the program's own folder (`$XDG_STATE_HOME/anyfs`) where left out. */
readonly stateDir?: string;
/** How the ssh program is run; the system's where left out. */
readonly run?: RunLocal;
readonly readStdin?: () => Promise<Uint8Array>;
readonly writeStdout?: (bytes: Uint8Array) => void;
/** Where a notice to the person goes (standard error by default). */
readonly notice?: (text: string) => void;
readonly stop?: AbortSignal;
};What a world is made from.
stateDirOffunctionno test imports itfunction stateDirOf(env: (name: string) => string | undefined): stringThe state folder of the program for an environment.
systemWorldfunctionfunction systemWorld(o: WorldOptions): WorldThe world of this process.
processEnvFnfunctionno test imports itfunction processEnvFn(): (name: string) => string | undefinedThe process's environment as a function that treats an empty variable as not set.
processCwdconstno test imports itconst processCwd: () => stringThe working folder of the process.