diff options
author | Alan Pearce | 2023-09-12 10:56:39 +0200 |
---|---|---|
committer | Alan Pearce | 2023-09-12 10:56:39 +0200 |
commit | 78439b16cc66532225e75c9aa40cf7c49cddc22d (patch) | |
tree | 24514d56345534ad50ad6180026d67b605fea071 /src/config.ts | |
parent | b45b4e37af14d94726b0c5d2691289886c0527cf (diff) | |
download | website-78439b16cc66532225e75c9aa40cf7c49cddc22d.tar.lz website-78439b16cc66532225e75c9aa40cf7c49cddc22d.tar.zst website-78439b16cc66532225e75c9aa40cf7c49cddc22d.zip |
Read config from TOML file
Diffstat (limited to 'src/config.ts')
-rw-r--r-- | src/config.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..064b038 --- /dev/null +++ b/src/config.ts @@ -0,0 +1,9 @@ +import path from "node:path"; +import fs from "node:fs"; +import toml from "toml"; + +export default function readConfig(base: string) { + const filename = path.join(base, "config.toml"); + + return toml.parse(fs.readFileSync(filename, "utf-8")); +} |