line-reader icon indicating copy to clipboard operation
line-reader copied to clipboard

Final callback is called even if all lines have not been read.

Open rickhuizinga opened this issue 11 years ago • 0 comments

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.

rickhuizinga avatar Dec 11 '13 00:12 rickhuizinga