MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / readConfigFile

Function readConfigFile

apps/desktop/src/mcp/vault-ops.ts:205–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203}
204
205async function readConfigFile(): Promise<Record<string, unknown> | null> {
206 const configPath = path.join(userDataDir(), 'zennotes.config.json')
207 try {
208 const raw = await fs.readFile(configPath, 'utf8')
209 const parsed = JSON.parse(raw) as unknown
210 return parsed && typeof parsed === 'object' ? (parsed as Record<string, unknown>) : null
211 } catch {
212 return null
213 }
214}
215
216export async function readVaultRootFromConfig(): Promise<string | null> {
217 const parsed = await readConfigFile()

Callers 2

readVaultRootFromConfigFunction · 0.70

Calls 1

userDataDirFunction · 0.70

Tested by

no test coverage detected