De Wiki inetshell
Saltar a: navegación, buscar

https://github.com/nickewing/line-reader

  • Instalacion
npm install line-reader
  • Código
var lineReader = require('line-reader');
lineReader.eachLine('file.txt', function(line, last) {
        // do whatever you want with line...
        console.log(line);
        if(last){
                // or check if it's the last one
        }
});