1
0

First commit

This commit is contained in:
2024-10-27 04:43:07 +01:00
parent 1dae13fe7e
commit 35f37491af
20 changed files with 2120 additions and 0 deletions

23
src/core/config.js Normal file
View File

@@ -0,0 +1,23 @@
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,
}