line-reader
line-reader copied to clipboard
line-reader not working after page refresh
Hi,
I am using electron.js and I have found line-reader is not working after a page refresh. It reads no lines and throws no errors. Not sure what is happening. It says trying to read the file (plus file name) and then nothing. The first line of File.parseLine is not getting hit. File.parseLine returns false after completion before the page refresh (which I assume allows line-reader to close the file).
File.parseLine works properly before the page refresh.
if (fs.existsSync(fileName[0])){ clearData(); //clear the old data before reading the file console.log("trying to read file: " + fileName[0]); lineReader.eachLine(fileName[0], File.parseLine); }