Skip to content

loadConfig

loadConfig(root, env?, home?, toolName?): Promise<LoadedConfig>

Load every layer and merge them. env and home are injectable for the same reason configLocations takes them.

toolName travels rather than being hardcoded because one of the warnings below tells the reader to run a command, and the command they can run is the binary they just invoked. Two binaries share this library and this trust store; naming the other one is an instruction the reader may not be able to follow. The default is waypost — the store’s own name, and the right answer for a programmatic caller that has no binary to name.

ParameterTypeDefault value
rootstringundefined
envRecord<string, string | undefined>process.env
homestring...
toolNamestring'waypost'

Promise<LoadedConfig>