read first n lines from file nodejs code example
Example 1: how to get a particular line from a file in nodejs
$ npm install --save line-reader
Example 2: how to get a particular line from a file in nodejs
lineReader.open('/path/to/file', function(reader) {
if (reader.hasNextLine()) {
reader.nextLine(function(line) {
console.log(line);
});
}
});