MCPcopy Index your code
hub / github.com/node-modules/utility / readJSON

Function readJSON

src/json.ts:36–39  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

34}
35
36export async function readJSON<T = any>(filepath: string): Promise<T> {
37 const content = await readFile(filepath, 'utf8');
38 return JSON.parse(content) as T;
39}
40
41export async function writeJSON(filepath: string, content: string | object, options: JSONStringifyOptions = {}) {
42 options.space = options.space ?? 2;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…