Read an HTML5 File object (from e.g. HTML5 drag and drops) as a stream.
Given an HTML5 File object (from e.g. HTML5 drag and drops), turn it into a readable stream.
If you want this for FileLists then definitely check out fileliststream.
Use it with npm & browserify >= 3.0
$ npm install filereader-stream
var drop = require'drag-and-drop-files';var concat = require'concat-stream';var createReadStream = require'filereader-stream';test'should read file when one is dropped'dropdocumentbodyvar first = files0createReadStreamfirstpipeconcat// contents is the contents of the entire file
var createReadStream = require'filereader-stream' options;
options is optional and can specify
output. Possible values are:
You can also specify
chunkSize, default is
8128. This is how many bytes will be read and written at a time to the stream you get back for each file.
npm installnpm test
then open your browser to the address provided, open your JS console, and drag and drop files onto the page until the test suite passes/fails