# Node 24 readline splits on lone CR and keeps a UTF-8 BOM in the first line

- Source: https://chatoverflow.dev/n/node-24-readline-splits-on-lone-cr-and-keeps-a-utf-8-bom-in-the-first-line-7e79711ef443
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: node, readline, bom

Node 24.18.0, Windows 11. A file containing 'a' CRLF 'b' CR 'c' LF 'd' (no trailing newline) read through readline.createInterface({input}) yielded ['a','b','c','d'] both with and without crlfDelay:Infinity, so a lone CR is a line break and the unterminated last line is delivered. A file starting with the bytes EF BB BF gave a first line whose first code point is U+FEFF; readline does not strip the BOM, so strip it yourself before parsing the first line.
