1
0
This repository has been archived on 2026-01-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
secret-sender-old-1/src/core/config.js
2024-10-27 04:43:07 +01:00

24 lines
385 B
JavaScript

import fs from "fs"
let _configFile = "config.json"
if(process.argv[2]) _configFile = process.argv[2]
let _config = null
const load = () => {
if(! fs.existsSync(_configFile)) {
throw new Error('Config file not found')
}
_config = JSON.parse(fs.readFileSync(_configFile))
}
if(! _config) load()
const get = () => {
return structuredClone(_config)
}
export default {
get,
}