Skip to content

loadJsonConfig

loadJsonConfig<T>(filePath, schema): Promise<JsonConfigResult<T>>

Defined in: packages/simply-core/src/config/loadJsonConfig.ts:62

Read a JSON config file and validate its contents against a schema.

T

string

The file to read.

ConfigSchema<T>

The schema to validate the parsed contents against.

Promise<JsonConfigResult<T>>

The validated value, or the validator’s error message.

If the file isn’t valid JSON.

If the file can’t be read.