line-reader
line-reader copied to clipboard
Final callback is called even if all lines have not been read.
The eachLine function is documented to return an object with one property, then. It is documented as:
"If a callback is provided to then, it will be called once all lines have been read."
The problem is that this callback function is called when reading of the file is stopped prematurely by returning (synchronous version) or passing (asynchronous version) false to the eachLine callback function. In this case, not all of the lines in the file have been read so the final callback function should not be called.