if (fs.exists('myfile.txt')) { if (fs.read('myfile.txt').length === 0) { console.log("File is Empty") } else { return JSON.parse(fs.read('myfile.txt')); } }