MCPcopy Create free account
hub / github.com/CytopiaTeam/Cytopia / formatFile

Function formatFile

tools/format-json.js:13–21  ·  view source on GitHub ↗
(file, index)

Source from the content-addressed store, hash-verified

11];
12
13function formatFile(file, index) {
14 fs.readFile(file, "utf8", (err, content) => {
15 if (err) throw err;
16 fs.writeFile(file, JSON.stringify( JSON.parse(content), null, 4), (err) => {
17 if (err) throw err;
18 console.log(`formatting file ${file} done`);
19 });
20 });
21}
22
23fileList.forEach(formatFile);

Callers

nothing calls this directly

Calls 2

readFileMethod · 0.80
writeFileMethod · 0.80

Tested by

no test coverage detected