hashes

tcmts.cli.test.e2e.fmt.hashes · #a7iod2yv · term · runs on the server

uses node:sqlite

import path from "node:path";
import { DatabaseSync } from "node:sqlite";

export function hashes(dir: string) {
  const db = new DatabaseSync(path.join(dir, ".tcm", "codebase.sqlite"), { readOnly: true });
  try {
    return db.prepare("SELECT path, hash FROM names ORDER BY path").all();
  } finally {
    db.close();
  }
}

used by