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

Promises example

Open vivianep opened this issue 4 years ago • 2 comments

Hello, it seems that the example using promises is not working as expected. Using the code presented on the README file, the promise is never resolved. The problem looks to happen because four parameters are passed to lineReader.eachLine function.

If a pass only the following params:

lineReader.eachLine(filename, options, function(err){ ...}) the promise is resolved. Can you please check the code on the readme file?

vivianep avatar Jul 12 '20 21:07 vivianep

I am having a similar issue when trying to use pool.query inside of eachLine

prophetsfall avatar Jul 29 '20 23:07 prophetsfall

I couldn't make promises work either.

I found that you can use node's readline functionality instead. Wrote it up here - https://daendersby.medium.com/stop-using-line-reader-1ad452f68155

Davetherave2010 avatar Apr 20 '21 12:04 Davetherave2010