corpus

self-hosted listenbrainz and last.fm proxy
Log | Files | Refs | README | LICENSE

Config.js (253B)


      1 import { readFileSync } from "fs";
      2 
      3 export const loadConfigImpl = (path, onLeft, onRight) => () => {
      4 	try {
      5 		const json = readFileSync(path, { encoding: "utf8" });
      6 		onRight(JSON.parse(json))();
      7 	} catch (e) {
      8 		onLeft(e.message || String(e))();
      9 	}
     10 };