UNPKG

depshield

Version:

Smart Dependency Analyzer & Optimizer - Find unused npm packages, reduce bundle size, and improve project health with AST-based detection.

19 lines (18 loc) 550 B
import fs from 'fs/promises'; import path from 'path'; import { DEFAULT_CONFIG } from './types.js'; export async function loadConfig(projectPath) { const configPath = path.join(projectPath, 'depshield.config.json'); try { const content = await fs.readFile(configPath, 'utf-8'); const userConfig = JSON.parse(content); return { ...DEFAULT_CONFIG, ...userConfig, }; } catch { // Config file doesn't exist or is invalid, use defaults return DEFAULT_CONFIG; } }