lineReader.eachLine('path/to/file', function(line) { console.log(line); if (line.includes('STOP') { return false; // stop reading } });