nickewing / line-reader

Asynchronous line-by-line file reader for node.js
MIT License
452 stars 76 forks source link

Promises example #43

Open vivianep opened 4 years ago

vivianep commented 4 years ago

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?

prophetsfall commented 4 years ago

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

Davetherave2010 commented 3 years ago

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