UNPKG

epd

Version:

Enhanced peer dependency resolution for npm, yarn, and pnpm

32 lines 947 B
import { readFile } from 'fs/promises'; import { existsSync } from 'fs'; import { join } from 'path'; const DEFAULT_CONFIG = { autoResolve: true, interactive: false, ignorePackages: [], preferredVersions: {}, timeout: 30000, retries: 3 }; export async function loadConfig(cwd = process.cwd()) { const configPaths = [ join(cwd, '.epdrc'), join(cwd, '.epdrc.json'), join(cwd, 'epd.config.json') ]; for (const configPath of configPaths) { if (existsSync(configPath)) { try { const content = await readFile(configPath, 'utf-8'); const config = JSON.parse(content); return { ...DEFAULT_CONFIG, ...config }; } catch (error) { console.warn(`⚠️ Invalid config file ${configPath}:`, error); } } } return DEFAULT_CONFIG; } //# sourceMappingURL=config.js.map