var fs = require('fs'); var text = fs.readFileSync("C:\...path\example.txt") var regx = /\n/g; text = text.toString().split(regx); console.log((text.length);
my example file is below (without a carriage return afert Line 4):
Line one. Line 1
Line two. Line 2
Line three. Line 3
Line four. Line 4
The ouput of the code (console.log) is 4 when i run my code but when i run learnyounode verify it say failed expected 33!