lineReader.eachLine('path/to/file', function(line) {
console.log(line);
if (line.includes('STOP') {
return false; // stop reading
}
});
$ npm install --save line-reader
lineReader.open('/path/to/file', function(reader) {
if (reader.hasNextLine()) {
reader.nextLine(function(line) {
console.log(line);
});
}
});