MCPcopy Create free account
hub / github.com/Silverfeelin/AnimalWell-Helper / saveNodeArray

Function saveNodeArray

scripts/nodes.js:31–43  ·  view source on GitHub ↗
(jsonArray)

Source from the content-addressed store, hash-verified

29});
30
31function saveNodeArray(jsonArray) {
32 const array = JSON.parse(jsonArray);
33 const json = JSON.stringify({ items: array });
34 const filePath = __dirname + "/../src/assets/nodes.json";
35
36 fs.writeFile(filePath, json, (err) => {
37 if (err) {
38 console.error("Error writing JSON to file:", err);
39 } else {
40 console.log("JSON written to file successfully");
41 }
42 });
43}

Callers 1

nodes.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected