ConfigFileSourceOptions
Type Alias: ConfigFileSourceOptions
Section titled “Type Alias: ConfigFileSourceOptions”ConfigFileSourceOptions =
object
Defined in: sources.ts:189
Options for configFileSource.
Properties
Section titled “Properties”
optionalcwd?:string
Defined in: sources.ts:196
Directory to start the search from. Defaults to process.cwd().
extensions?
Section titled “extensions?”
optionalextensions?:string[]
Defined in: sources.ts:201
Extensions to try, in priority order — first match wins. Defaults to
["ts", "js", "mjs", "cjs", "json"].
optionalload?:ConfigFileLoader
Defined in: sources.ts:219
Custom loader for the discovered file. Receives the absolute path and
returns the evaluated module (or its default export). Supply this to
compile TypeScript/ESM on the fly (esbuild, jiti, …) so config-kit
doesn’t hard-depend on a compiler. If it returns a module namespace, the
default export is unwrapped automatically.
When omitted, the file is loaded with a native dynamic import() (and
.json is read + parsed directly). That handles .js/.mjs/.cjs/
.json on any modern runtime; .ts needs a custom loader unless your
runtime imports TypeScript natively.
name:
string
Defined in: sources.ts:194
Base name of the config file. name: "app" looks for
app.config.<ext>. Also used (prefixed) as the source’s diagnostic name.
searchParents?
Section titled “searchParents?”
optionalsearchParents?:boolean
Defined in: sources.ts:206
Walk up parent directories until a match is found (like how tools locate
a config from a nested working directory). Defaults to true.