Answers for "File line by line reader Node js"

0

File line by line reader Node js

var lineReader = require('line-reader');

lineReader.eachLine('file.txt', function(line, last) {
  console.log(line);
  // do whatever you want with line...
  if(last){
    // or check if it's the last one
  }
});
Posted by: Guest on May-25-2021
0

File line by line reader Node js

lineReader.open('file.txt', function(reader) {
  if (reader.hasNextLine()) {
    reader.nextLine(function(line) {
      console.log(line);
    });
  }
});
Posted by: Guest on May-25-2021

Code answers related to "File line by line reader Node js"

Browse Popular Code Answers by Language