cc-space / src /kb.js
github-actions
Deploy 2c82127
843f9e1
Raw History Blame Contribute Delete
327 Bytes
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import path from "node:path";
const here = path.dirname(fileURLToPath(import.meta.url));
export const KB_PATH = path.resolve(here, "../data/kb.json");
export function loadKb(file = KB_PATH) {
return JSON.parse(readFileSync(file, "utf8"));
}