Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for read/write streams #9

Open
MarkMurphy opened this issue Apr 28, 2017 · 0 comments
Open

Support for read/write streams #9

MarkMurphy opened this issue Apr 28, 2017 · 0 comments

Comments

@MarkMurphy
Copy link

I'm looking for a method to read a file in chunks by specifying a start and end offset similar to that of node's fs.createReadStream method:

options can include start and end values to read a range of bytes from the file instead of the entire file. Both start and end are inclusive and start counting at 0. If fd is specified and start is omitted or undefined, fs.createReadStream() reads sequentially from the current file position.

An example to read the last 10 bytes of a file which is 100 bytes long:

fs.createReadStream('sample.txt', {start: 90, end: 99});

This would allow me to implement a resumable upload interface so that I can take advantage of API's like those from Dropbox, YouTube, AWS, Vimeo, etc. and the TUS protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant