search
Static method that searches for a config file across service-specific paths,
caller-supplied directories, and default standard locations. Returns a loaded
ConfigLoader as soon as the first existing file is found, or null if none
of the candidates exist.
Default search paths (joined with filename, in order):
${cwd}/${filename}${cwd}/config/${filename}$HOME/.signalwire/${filename}${cwd}/.swml/${filename}$HOME/.swml/${filename}/etc/swml/${filename}
When serviceName is provided, two service-specific variants are checked
before any other path:
${cwd}/${serviceName}_${filename}${cwd}/.swml/${serviceName}_${filename}
When additionalPaths is provided, those directories are checked (joined
with filename) after the service-specific variants but before the defaults.
Parameters
filename
The config file name to search for (e.g., "config.json").
additionalPaths
Extra directories to search before the default locations. Each directory
is joined with filename to form a candidate path.
serviceName
Optional service name. When provided, adds ${serviceName}_${filename}
variants to the front of the search order so a service can override the
generic config file.
Returns
ConfigLoader | null — A loaded ConfigLoader instance, or null if no
candidate path exists.