layoutOf
uses node:sqlite
The table layout a codebase's database is in (its layout setting), if it says.
import { DatabaseSync } from "node:sqlite"; export function layoutOf(file: string): string | undefined { const db = new DatabaseSync(file, { readOnly: true }); try { return ( db.prepare("SELECT value FROM settings WHERE key = 'layout'").get() as | { value: string } | undefined )?.value; } catch { return undefined; } finally { db.close(); } }