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
var fs=require('fs'); filename=process.argv[2]; var data=fs.readFileSync(filename); var res=data.toString().split('\n').length; console.log(res-1);`