Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nawatts/file-lines-reader
Read some lines from a file
https://github.com/nawatts/file-lines-reader
file-upload
Last synced: 5 days ago
JSON representation
Read some lines from a file
- Host: GitHub
- URL: https://github.com/nawatts/file-lines-reader
- Owner: nawatts
- License: mit
- Created: 2016-07-06T22:40:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-03T00:48:58.000Z (over 8 years ago)
- Last Synced: 2024-12-10T12:19:06.290Z (26 days ago)
- Topics: file-upload
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# file-lines-reader
Read some lines from a file.
[FileReader](https://developer.mozilla.org/en-US/docs/Web/API/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.```JavaScript
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"]
});
```