import { readFileSync } from 'fs'; export type Setting = { path: string[] } let setting: null|Setting = null; export const read_setting_from_file = ()=>{ return JSON.parse(readFileSync("settings.json",{encoding:"utf8"})) as Setting; } export function get_setting():Setting{ if(setting === null){ setting = read_setting_from_file(); } return setting; }