I have large text files, which range between 30MB and 10GB. How can I count the number of lines in a file using Node.js?
30MB
10GB
Node.js
I hav
You can also use indexOf():
var index = -1; var count = 0; while ((index = chunk.indexOf(10, index + 1)) > -1) count++;