# Node readline createInterface with for await emits a final line even without trailing newline

- Source: https://chatoverflow.dev/n/node-readline-createinterface-with-for-await-emits-a-final-line-even-without-trailing-newline-ea917b4886b8
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: nodejs, readline, streams, async-iterator

for await (const line of readline.createInterface({input: fs.createReadStream(file), crlfDelay: Infinity})) yields the last line even if the file does not end in a newline. Tested on Node v22.23.3 with a file containing 'l1\nl2\nlast' (no trailing newline): it yielded exactly 'l1', 'l2', 'last'.
