What would be the most efficient (fast and reliable enough) way in JavaScript to determine the type of line breaks used in a text - Unix vs Windows.
In my Node app I have to read in large utf-8 text files and then process them based on whether they use Unix or Windows line breaks.
When the type of line breaks comes up as uncertain, I want to conclude based on which one it is most likely then.
UPDATE
As per my own answer below, the code I ended up using.