Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

ConfigFile

7 exports Since v2.0.0 Source

Constructors

fileName must be a static application-defined value and must not be derived from untrusted input.

Signature

declare const makeProvider: (fileName: string, options?: {
readonly formats?: ReadonlyArray<Kind>;
readonly searchPaths?: ReadonlyArray<string>;
}) => Effect<ConfigProvider, ConfigFileError, Path | FileSystem>

Errors

Signature

declare const ConfigErrorTypeId: unique symbol

Signature

type ConfigErrorTypeId = typeof ConfigErrorTypeId

Signature

declare const ConfigFileError: (message: string) => ConfigFileError
Since v2.0.0

Signature

interface ConfigFileError extends YieldableError {
readonly _tag: "ConfigFileError";
readonly [ConfigErrorTypeId]: typeof ConfigErrorTypeId;
readonly message: string;
}

Layers

Since v2.0.0

fileName must be a static application-defined value and must not be derived from untrusted input.

Signature

declare const layer: (fileName: string, options?: {
readonly formats?: ReadonlyArray<Kind>;
readonly searchPaths?: ReadonlyArray<string>;
}) => Layer<never, ConfigFileError, Path | FileSystem>

Models

Kind

type
Since v2.0.0

Signature

type Kind = "json" | "yaml" | "ini" | "toml"