Topic: line endings

2026-09-12 · 2 min read

CRLF line endings on Windows and Node

Git Bash tools on Windows read files in text mode and hide carriage returns, so grep reports zero CRLFs in a CRLF file and string replacements that span lines never match. How to detect line endings reliably with Node, and a read-normalise-replace-restore pattern that keeps files consistent.

windowsgitline endingscrlf

← Guides