max-mapper / filereader-stream

Read an HTML5 File object (from e.g. HTML5 drag and drops) as a stream.
BSD 2-Clause "Simplified" License
102 stars 18 forks source link

New methods, events and offset option #1

Closed 1N50MN14 closed 10 years ago

1N50MN14 commented 10 years ago

Hi Max,

I added the following: Events: error - triggered when FileReader encounters an error reading data from the file, emits error end - triggered when all chunks are successfully read and written, emits file.size progress - triggered upon each write, emit current offset

Methods: pause - pauses read / write, returns current offset resume - resumes read / write abort - aborts FileReader and ends/closes destination stream

Options: offset - optional offset option, very handy in case of abort

Hope this looks ok to you

max-mapper commented 10 years ago

thanks! I published this as 0.1.0 just now. do you feel like adding a couple of integration tests to test.js that make use of the new functionality so that we can catch regressions in the future? here are instructions for running the tests https://github.com/maxogden/filereader-stream#run-the-tests

1N50MN14 commented 10 years ago

Absolutely that's the plan! will finish my dinner here and send a PR on test.js in couple of hours