coffi
Version:
⚡️ A fast, lightweight, easy-to-use, configuration files loader 📄
16 lines (15 loc) • 589 B
TypeScript
type Extention = ".ts" | ".mts" | ".cts" | ".js" | ".mjs" | ".cjs" | ".json";
interface LoadConfigOptions {
name: string;
extensions?: Extention[];
cwd?: string;
maxDepth?: number;
preferredPath?: string;
packageJsonProperty?: string;
}
interface LoadConfigResult<T> {
config: T | null;
filepath: string | null;
}
declare function loadConfig<T = unknown>(nameOrOptions: string | LoadConfigOptions, extensions?: string[], options?: Omit<LoadConfigOptions, "name" | "extensions">): Promise<LoadConfigResult<T>>;
export { loadConfig, LoadConfigResult, LoadConfigOptions, Extention };