userCache

tcmts.cli.browser.userCache · #ubh5yvxd · function · runs on the server

uses node:path

Where tcm installs what it runs for any codebase, or outside one (tcm browser's agent-browser, too big to ship with tcm): one install for the user, as a codebase's .tcm/cache is one for the codebase: tcm in XDG_CACHE_HOME, else in ~/.cache.

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

export function userCache(): string {
  return path.join(process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache"), "tcm");
}

used by