nodejs only read a specific line code example
Example 1: how to get a particular line from a file in nodejs
lineReader.eachLine('path/to/file', function(line) {
console.log(line);
if (line.includes('STOP') {
return false; // stop reading
}
});
Example 2: how to get a particular line from a file in nodejs
$ npm install --save line-reader