ConfigLoader
ConfigLoader loads JSON configuration files and substitutes environment
variables using ${VAR|default} syntax. It provides dot-notation access
for nested values and supports method chaining.
Constructor
filePath
Path to a JSON config file to load on construction. If omitted, use
load() or loadFromObject() later.
Methods
load
Load configuration from a JSON file with env var interpolation.
search
Static method to find and load a config file from standard locations.
get
Get a value by dot-notation path.
set
Set a value at a dot-notation path.
has
Check whether a dot-notation path exists.
getAll
Return a shallow copy of the entire configuration object.
getFilePath
Return the absolute path of the loaded config file.
loadFromObject
Load configuration from a plain object instead of a file.