Skip to content

@pumpkin-plugins/config API / load / loadConfig

Function: loadConfig() ​

loadConfig<S>(schema, store, options?): LoadResult<ConfigValues<S>>

Defined in: tools/config/src/load.ts:52

Reads a config file and brings it in line with the schema: a missing file is created, new settings are added and removed ones dropped, and the user's values are kept. A file with an invalid value is never rewritten, so what the user typed isn't lost.

Type Parameters ​

S ​

S extends ConfigSchema<Record<string, ConfigNode>>

Parameters ​

schema ​

S

The config schema.

store ​

ConfigStore

Where the file lives.

options? ​

RenderOptions = {}

Rendering options.

Returns ​

LoadResult<ConfigValues<S>>

The values and a report of what changed.

Throws ​

When the file isn't valid TOML. The file is not modified.

Pumpkin Plugins documentation