-
Notifications
You must be signed in to change notification settings - Fork 30
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
Consider exposing intenal read
method as separate export
#52
Comments
Why don't you use native web blob instead? I have recently been thinking how to make this Deno compatible...
stream () {
if (globalThis.ReadableStream?.from) {
return ReadableStream.from(read(...))
} else {
import('stream').then(({Readable}) => Readable.from(read(...)))
}
} Deno and browser have whatwg - ReadableStream would it help if this used whatwg streams instead of exposing Edit: just saw that you mention something like it in #51 |
We do on the web, but share the same code with node. So we need a common reading function with little to no overhead.
👍
This is more or less what I end up doing in https://github.com/Gozala/web-blob. It does subclass |
In our code base we abstract between node & browser via function that reads contents as
AsyncIterable<Uint8Array>
. This library internally hasread
that pretty much does that, which then is wrapped in a node Readable.Maybe instead of providing web incompatible
stream()
method internalread()
could be exposed instead ?The text was updated successfully, but these errors were encountered: