nawatts / file-lines-reader

Read some lines from a file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

file-lines-reader

Read some lines from a file.

FileReader reads all file content at once. This slices a file into smaller chunks and reads one at a time until the desired number of lines are found.

var reader = new FileLinesReader(/* File or Blob */ file);

reader.readLines(3).then(function(lines) {
  console.log(lines); // ["line1", "line2", "line3"]
});

reader.readLines(1).then(function(lines) {
  console.log(lines); // ["line4"]
});

About

Read some lines from a file

License:MIT License


Languages

Language:JavaScript 80.5%Language:HTML 19.5%