MCPcopy Index your code
hub / github.com/BlockRunAI/ClawRouter / readTextFileSync

Function readTextFileSync

src/fs-read.ts:30–45  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

28
29/** Read file contents as UTF-8 string (sync). */
30export function readTextFileSync(filePath: string): string {
31 const fd = openSync(filePath, "r");
32 try {
33 const size = fstatSync(fd).size;
34 const buf = Buffer.alloc(size);
35 let offset = 0;
36 while (offset < size) {
37 const bytesRead = readSync(fd, buf, offset, size - offset, offset);
38 if (bytesRead === 0) break;
39 offset += bytesRead;
40 }
41 return buf.subarray(0, offset).toString("utf-8");
42 } finally {
43 closeSync(fd);
44 }
45}

Callers 6

loadMethod · 0.85
installSkillsToWorkspaceFunction · 0.85
injectModelsConfigFunction · 0.85
injectAuthProfileFunction · 0.85
createWalletCommandFunction · 0.85
deactivateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected