The config provider's options object. This defines where the config will be pulled from and the default values for the config.

Hierarchy

  • ConfigProviderOptions

Properties

configPath?: string

The resolved path where the JSON config file is located. This should resolve to the actual JSON file.

customValidators?: ConfigCustomValidators

An object that maps a config key to a custom validator function. This validator function will be used to validate the config supplied. It will skip the default type validator and instead use the one specified here. This function should not return anything, but throw a TypeError if the given value is not correct.

default?: Record<string, ConfigValue>

The default config values in case they weren't provided by any of the previously mentioned sources.

env?: ProcessEnv | Record<string, string>

The environment variables object to be used. This should generally be process.env unless your variables are pre-processed.

types?: Record<string, string | string[]>

The types of each config for the validator to validate. It can be a string or an array of strings. Types can be: boolean, number, string, or null.

Generated using TypeDoc