hashOf
uses node:sqlite
import path from "node:path"; import { DatabaseSync } from "node:sqlite"; export const hashOf = (name: string, root: string) => { const db = new DatabaseSync(path.join(root, ".tcm", "codebase.sqlite"), { readOnly: true }); try { return (db.prepare("SELECT hash FROM names WHERE path = ?").get(name) as { hash: string }).hash; } finally { db.close(); } }