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.
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”Promise<JsonConfigResult<T>>
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.