MCPcopy Create free account
hub / github.com/cutupdev/Solana-Volume-Bot / readJson

Function readJson

utils/utils.ts:95–102  ·  view source on GitHub ↗
(filename: string = "data.json")

Source from the content-addressed store, hash-verified

93
94// Function to read JSON file
95export function readJson(filename: string = "data.json"): Data[] {
96 if (!fs.existsSync(filename)) {
97 // If the file does not exist, create an empty array
98 fs.writeFileSync(filename, '[]', 'utf-8');
99 }
100 const data = fs.readFileSync(filename, 'utf-8');
101 return JSON.parse(data) as Data[];
102}
103
104// Function to write JSON file
105export function writeJson( data: Data[], filename: string = "data.json",): void {

Callers 4

status.tsFile · 0.90
sellFunction · 0.90
sellFunction · 0.90
editJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected