keptInto

tcmts.studio.keptInto · #c6x547v6 · term · runs on the server

uses node:fs

The names the files kept as written that the studio's editing go back to, by their scratch files' paths.

import type { Codebase } from "#codebase/tcmts/cli/codebase";
import { keptIntoFile } from "#codebase/tcmts/studio";
import fs from "node:fs";

export function keptInto(cb: Codebase): Record<string, string> {
  try {
    return JSON.parse(fs.readFileSync(keptIntoFile(cb), "utf8")) as Record<string, string>;
  } catch {
    return {};
  }
}

uses

used by