Skip to content

loadJsonConfigSync

loadJsonConfigSync<T>(filePath, schema): JsonConfigResult<T>

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

Synchronous loadJsonConfig, for callers already running outside an async context.

T

string

The file to read.

ConfigSchema<T>

The schema to validate the parsed contents against.

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.