-
file-reader is a ES6 Generator function which returns an iterable to iterater over content in a
file
orstdin
chunk by chunk using.next()
method orfor..of
loop. -
npm install git+https://github.com/Vikasg7/file-reader.git
-
const reader: IterableIterator<Buffer> = FileReader(fileOrStdinOrFd: string | number | NodeJS.ReadStream, startAt?: number, chunkSizeInBytes?: number)
-
import { FileReader } from "file-reader" const file = process.argv[2] const reader = FileReader(file) const loop = setInterval(() => { const {done, value} = reader.next() if (!done) process.stdout.write(value) else clearInterval(loop) }, 1)
-
Check the tests folder in src folder for an example.
-
Notifications
You must be signed in to change notification settings - Fork 0
Vikasg7/file-reader
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Generator function* to read a file chunk by chunk in nodejs
Topics
Resources
Stars
Watchers
Forks
Packages 0
No packages published