Skip to content

Config

Defined in: src/config/Config.ts:28

Immutable configuration tree loaded from HOCON files and/or code overrides. All accessors throw ConfigError on missing or incorrectly-typed paths; hasPath lets callers probe beforehand.

Primary entry points:

  • Config.load() — merge reference.conf + application.conf + env.
  • Config.parseString(s) — parse an inline HOCON snippet.
  • Config.parseFile(path) — parse a file.
  • Config.fromObject(obj) — build from a plain JS object (code overrides).

atPath(path): Config

Defined in: src/config/Config.ts:182

Wrap the tree under the given path: {a:{b:1}}.atPath(“x.y”) → {x:{y:{a:{b:1}}}}.

string

Config


getBoolean(path): boolean

Defined in: src/config/Config.ts:113

string

boolean


getBytes(path): number

Defined in: src/config/Config.ts:133

Byte count.

string

number


getConfig(path): Config

Defined in: src/config/Config.ts:162

string

Config


getDuration(path): number

Defined in: src/config/Config.ts:125

Duration in milliseconds.

string

number


getInt(path): number

Defined in: src/config/Config.ts:100

string

number


getList(path): ConfigValue[]

Defined in: src/config/Config.ts:150

string

ConfigValue[]


getNumber(path): number

Defined in: src/config/Config.ts:106

string

number


getObject(path): ConfigObject

Defined in: src/config/Config.ts:156

string

ConfigObject


getString(path): string

Defined in: src/config/Config.ts:93

string

string


getStringList(path): string[]

Defined in: src/config/Config.ts:140

string

string[]


hasPath(path): boolean

Defined in: src/config/Config.ts:89

string

boolean


merge(overlay): Config

Defined in: src/config/Config.ts:177

Inverse of withFallback — layer overlay on top.

Config

Config


toJSON(): ConfigObject

Defined in: src/config/Config.ts:193

Deep-clone the underlying tree as a plain object.

ConfigObject


withFallback(other): Config

Defined in: src/config/Config.ts:172

Merge other underneath this config — i.e. values defined here win, keys that only exist in other are filled in.

Config

Config


static empty(): Config

Defined in: src/config/Config.ts:33

Config


static fromObject(obj): Config

Defined in: src/config/Config.ts:45

unknown

Config


static load(options?): Config

Defined in: src/config/Config.ts:64

Load the standard config chain. Precedence (highest first):

  1. overrides passed in code.
  2. application.conf resolved via appConfPathprocess.env.ACTOR_TS_CONFIG./application.conf in CWD.
  3. reference.conf bundled with this package.

Environment variables are consulted during substitution resolution (inside each parse step), not as a separate layer.

LoadOptions = {}

Config


static loadReference(): Config

Defined in: src/config/Config.ts:81

Config


static parseFile(path): Config

Defined in: src/config/Config.ts:40

string

Config


static parseString(source): Config

Defined in: src/config/Config.ts:35

string

Config