Download src/lib/db/paths.js from shimen/kirway: direct link, hf CLI and curl.
- Browser
- Download file 657 Bytes
-
https://huggingface.co/spaces/shimen/kirway/resolve/main/src/lib/db/paths.js
- Command line
-
hf download hf://spaces/shimen/kirway/src/lib/db/paths.js
-
curl -L -o paths.js https://huggingface.co/spaces/shimen/kirway/resolve/main/src/lib/db/paths.js
657 Bytes
| import path from "node:path"; | |
| import fs from "node:fs"; | |
| import { DATA_DIR } from "@/lib/dataDir.js"; | |
| export const DB_DIR = path.join(DATA_DIR, "db"); | |
| export const DATA_FILE = path.join(DB_DIR, "data.sqlite"); | |
| export const BACKUPS_DIR = path.join(DB_DIR, "backups"); | |
| export const LEGACY_FILES = { | |
| main: path.join(DATA_DIR, "db.json"), | |
| usage: path.join(DATA_DIR, "usage.json"), | |
| disabled: path.join(DATA_DIR, "disabledModels.json"), | |
| details: path.join(DATA_DIR, "request-details.json"), | |
| }; | |
| export function ensureDirs() { | |
| for (const dir of [DATA_DIR, DB_DIR, BACKUPS_DIR]) { | |
| if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true }); | |
| } | |
| } | |