converted to ts

This commit is contained in:
2026-02-15 11:45:50 +05:30
parent 6375434aaa
commit 4bbba45642
11 changed files with 882 additions and 232 deletions
+18
View File
@@ -0,0 +1,18 @@
import { Settings } from './types';
import * as fs from 'fs';
import * as path from 'path';
function ReadSettings(): Settings | null {
try {
console.log("Reading settings.json");
const settings_txt = fs.readFileSync("settings.json", 'utf-8');
const settings: Settings = JSON.parse(settings_txt);
console.log("Done");
return settings;
} catch (err) {
console.error("Error: couldn't read settings.json. make sure its there and valid", err);
return null;
}
}
export default ReadSettings;