diff options
| author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-07-28 14:10:38 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-07-28 14:10:38 -0700 |
| commit | ad74ff999589e0df2b60ba6e94362ed5215af312 (patch) | |
| tree | a10800668c18c7b9f7222ac9fabbca01b941f834 /src/config.ts | |
| parent | 452c41a75aa2f9036614d677fda3867221db959e (diff) | |
| download | mon.hatecomputers.club-ad74ff999589e0df2b60ba6e94362ed5215af312.tar.gz mon.hatecomputers.club-ad74ff999589e0df2b60ba6e94362ed5215af312.zip | |
something
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 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<Config> => + () => { + const confStr = readFileSync(filePath, "utf-8"); + return JSON.parse(confStr); + }; |
