MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / loadConfig

Function loadConfig

speedlink/speedlink.ts:242–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

240const CONFIG_PATH = path.join(ASSETS_DIR, "config.json");
241const SPEEDTEST_PATH = path.join(ASSETS_DIR, "speedtest");
242const SPEEDTEST_VERSION = "1.2.0";
243
244// --- Load/Save configuration ---
245function loadConfig(): { timeout?: number } {
246 try {
247 if (fs.existsSync(CONFIG_PATH)) {
248 return JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
249 }
250 } catch (e) {
251 console.error("Failed to load config:", e);
252 }
253 return {};
254}

Callers 2

speedlink.tsFile · 0.70
speedtestFunction · 0.70

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected