Re:My Node.js is a bit Rusty
by nightlyherb on Friday September 08, 2023 @07:17AM
(#37432109)
N.B. Assuming `readLineStream` in that for await loop is node's readline object, the code is iterating over an asyncIterator[1] which works exactly as what you describe in your solution. (AsyncIterators have a next method that returns a Promise of the next item)
[1] https://nodejs.org/api/readline.html#rlsymbolasynciterator