Using a Config Provider with an Effect to Read a JSON File

How do I use a config provider that relies on an effect, e.g. reading an env JSON file?

const ConfigFromFile = FileSystem.FileSystem.pipe(
    Effect.flatMap((fs) => fs.readFileString("env.json")),
    Effect.map((json) => ConfigProvider.fromJson(json)),
);
Was this page helpful?