MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / safeFeadJSONFile

Function safeFeadJSONFile

packages/cli-v3/src/utilities/fileSystem.ts:56–68  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

54}
55
56export async function safeFeadJSONFile(path: string) {
57 try {
58 const fileExists = await pathExists(path);
59
60 if (!fileExists) return;
61
62 const fileContents = await readFile(path);
63
64 return JSON.parse(fileContents);
65 } catch {
66 return;
67 }
68}
69
70export async function writeJSONFile(path: string, json: any, pretty = false) {
71 await writeFile(path, JSON.stringify(json, undefined, pretty ? 2 : undefined), "utf8");

Callers

nothing calls this directly

Calls 3

parseMethod · 0.80
pathExistsFunction · 0.70
readFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…