all repos — website @ 78439b16cc66532225e75c9aa40cf7c49cddc22d

My website

Read config from TOML file

Alan Pearce
commit

78439b16cc66532225e75c9aa40cf7c49cddc22d

parent

b45b4e37af14d94726b0c5d2691289886c0527cf

1 file changed, 9 insertions(+), 0 deletions(-)

changed files
A 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")); +}