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

Function writeJSON

src/json.ts:41–48  ·  view source on GitHub ↗
(filepath: string, content: string | object, options: JSONStringifyOptions = {})

Source from the content-addressed store, hash-verified

39}
40
41export async function writeJSON(filepath: string, content: string | object, options: JSONStringifyOptions = {}) {
42 options.space = options.space ?? 2;
43 if (typeof content === 'object') {
44 content = JSON.stringify(content, options.replacer, options.space) + '\n';
45 }
46 await mkdir(dirname(filepath), { recursive: true });
47 await writeFile(filepath, content, 'utf8');
48}

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…