File.prototype.createStream produces a Readable stream, which can be piped to a Writable destination like an Express response
File.prototype.read produces a Uint8Array containing the entire contents of the file
Note that the array produced by read is actually a view on top of the underlying Emscripten memory. As a result, it's dangerous to use the Uint8Array after calling File.prototype.close.
This implements two reading APIs:
File.prototype.createStream
produces aReadable
stream, which can bepipe
d to aWritable
destination like an Express responseFile.prototype.read
produces aUint8Array
containing the entire contents of the fileNote that the array produced by
read
is actually a view on top of the underlying Emscripten memory. As a result, it's dangerous to use theUint8Array
after callingFile.prototype.close
.Closes #6