From ad74ff999589e0df2b60ba6e94362ed5215af312 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 28 Jul 2024 14:10:38 -0700 Subject: something --- src/config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/config.ts') diff --git a/src/config.ts b/src/config.ts index dd96169..2da569f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,7 +1,16 @@ +import * as IO from "fp-ts/IO"; import type { Publisher } from "./publisher"; +import { readFileSync } from "fs"; export interface Config { result_publishers: Publisher[]; dns: string[]; timeout: string; } + +export const readConfig = + (filePath: string): IO.IO => + () => { + const confStr = readFileSync(filePath, "utf-8"); + return JSON.parse(confStr); + }; -- cgit v1.3