wc -l does not count the number of lines, but counts the number of new lines, the exercise remains ambiguous about clarifying that
a file with no trailing new line,
wc -l will only return 2
"a
b
c"
similar to the exercise. trailing new line counts.
this will decide if you need a -1, or not
console.log(fileContents.toString().split('\n').length-1);