readline-promise icon indicating copy to clipboard operation
readline-promise copied to clipboard

Read file with a LF at the end

Open JuustoMestari opened this issue 6 years ago • 6 comments

Hi, I was testing the module with a file having a LF character as the latest character and it looks like it is not working properly. There is no error message so it's difficult to figure out what the problem is. I have tested the same file with the standard readline module and it works fine. I was using it like this : await rlp.forEach((line, index) => { console.log(line); }) Could someone test and let me know if you get the same issue?

JuustoMestari avatar Jun 06 '19 07:06 JuustoMestari

Please provide a test file and code to reproduce

bhoriuchi avatar Jun 06 '19 14:06 bhoriuchi

See : https://github.com/JuustoMestari/readline-promise

JuustoMestari avatar Jun 06 '19 14:06 JuustoMestari

I've confirmed this bug on my own test file. Removing the final LF character enable the promise to resolve.

hwinkler avatar Nov 03 '19 17:11 hwinkler

Inserting a zero-length line anywhere in __test__/file.txt causes the unit tests to fail.

hwinkler avatar Nov 04 '19 15:11 hwinkler

Any chance this will be updated? Running into this issue as well

bilalshaikh42 avatar Dec 13 '20 09:12 bilalshaikh42

i added some test cases which all passed on the current code. I have also updated the dev deps and published v1.0.5 please see if your issues are resolved.

bhoriuchi avatar Dec 15 '20 19:12 bhoriuchi