Skip to content

loadConfigPath

loadConfigPath<T>(filepath): Promise<T>

Defined in: cli/datapad/src/load-config-path/load-config-path.ts:20

Load the one file at filepath, whatever its name: .json is parsed, .ts goes through tsx, and .js, .mjs and .cjs are imported; the default export is the value. For a file the caller names (a flag’s argument) rather than one found by convention.

Throws ConfigFileError when the file is missing, has an extension that is not one of DEFAULT_EXTENSIONS, or cannot be loaded.

T = unknown

string

Absolute path of the file.

Promise<T>