{"path":"lib/config.js","size":528,"locked":false,"binary":false,"truncated":false,"content":"import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nconst CONFIG_FILE = 'anchr.json';\n\nexport function writeConfig(cwd, config) {\n  const path = join(cwd, CONFIG_FILE);\n  writeFileSync(path, JSON.stringify(config, null, 2) + '\\n');\n  return path;\n}\n\nexport function readConfig(cwd) {\n  const path = join(cwd, CONFIG_FILE);\n  if (!existsSync(path)) {\n    throw new Error('No anchr.json found — run `anchr init` first.');\n  }\n  return JSON.parse(readFileSync(path, 'utf-8'));\n}\n"}