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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”filePath
Section titled “filePath”string
The file to read.
schema
Section titled “schema”ConfigSchema<T>
The schema to validate the parsed contents against.
Returns
Section titled “Returns”The validated value, or the validator’s error message.
Throws
Section titled “Throws”If the file isn’t valid JSON.
Throws
Section titled “Throws”If the file can’t be read.