MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / readFileContentOrNull

Function readFileContentOrNull

src/utils/file.ts:138–143  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

136 * Read file content if it exists, otherwise return null.
137 */
138export async function readFileContentOrNull(filepath: string): Promise<string | null> {
139 if (await fileExists(filepath)) {
140 return readFileContent(filepath);
141 }
142 return null;
143}
144
145export async function readFileBuffer(filepath: string): Promise<Buffer> {
146 return readFile(filepath);

Callers 15

writeAiFilesFunction · 0.85
writeAiDirsFunction · 0.85
readOpencodeConfigFunction · 0.85
fromFileMethod · 0.85
fromFileMethod · 0.85
fromFileMethod · 0.85
fromFileMethod · 0.85

Calls 2

fileExistsFunction · 0.85
readFileContentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…