slotsDir

tcmts.cli.budget.slotsDir · #usim6c7t · term · runs on the server

uses node:path

Where the machine's slots are: TCM_SLOTS_DIR, or a directory of the user's in the temporary directory (tcm-suite-slots-<uid>, named when only suites took them), the same for every tcm they run.

import os from "node:os";
import path from "node:path";

export function slotsDir(): string {
  if (process.env.TCM_SLOTS_DIR) return path.resolve(process.env.TCM_SLOTS_DIR);
  const uid = typeof process.getuid === "function" ? process.getuid() : os.userInfo().username;
  return path.join(os.tmpdir(), `tcm-suite-slots-${uid}`);
}

used by