import * as fs from 'node:fs'; import yaml from 'yaml-js'; let _config = null; export function get_config() { if (_config !== null) { return _config; } try { const content = fs.readFileSync('./config.yaml', 'utf-8'); _config = yaml.load(content); } catch (e) { if (e.code === 'ENOENT') { _config = {}; } else { throw e; } } return _config; }