From 78439b16cc66532225e75c9aa40cf7c49cddc22d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 12 Sep 2023 10:56:39 +0200 Subject: Read config from TOML file --- src/config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/config.ts (limited to 'src/config.ts') 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")); +} -- cgit 1.4.1