MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / readFile

Function readFile

src/fileSystem/index.js:84–96  ·  view source on GitHub ↗
(encoding, progress)

Source from the content-addressed store, hash-verified

82 (url) => {
83 return {
84 async readFile(encoding, progress) {
85 const data = await ajax.get(url, {
86 responseType: "arraybuffer",
87 contentType: "application/x-www-form-urlencoded",
88 onprogress: progress,
89 });
90
91 if (encoding) {
92 return await decode(data, encoding);
93 }
94
95 return data;
96 },
97 async writeFile(content, progress) {
98 return ajax.post(url, {
99 data: content,

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected