MCPcopy Create free account
hub / github.com/anomalyco/opencode / readJson

Function readJson

packages/tui/src/util/persistence.ts:8–10  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

6}
7
8export function readJson<T>(filePath: string) {
9 return Bun.file(filePath).json() as Promise<T>
10}
11
12export async function writeText(filePath: string, content: string) {
13 await mkdir(path.dirname(filePath), { recursive: true })

Callers 3

kv.tsxFile · 0.90
createModelFunction · 0.90
createSessionFunction · 0.90

Calls 2

fileMethod · 0.80
jsonMethod · 0.65

Tested by

no test coverage detected