ReadableStream.prototype.text(), .blob(), and .bytes()
Adds utility methods to akin to the Body mixin for fully reading the contents of a ReadableStream as either text, a Blob, or a Uint8Array.
This is a first pass at addressing #1019 ....
In this, I add only the text(), bytes(), and blob() methods. text() returns a promise for UTF-8 decoded text, bytes() returns a promise for a Uint8Array, and blob() returns a promise for a Blob. It is modeled heavily on the fetch spec Body mixin definitions with a few tweaks.
Refs: https://github.com/whatwg/streams/issues/1019
- [ ] At least two implementers are interested (and none opposed):
- Cloudflare Workers
- Node.js
- ...
- [ ] Tests are written and can be reviewed and commented upon at:
- …
- [ ] Implementation bugs are filed:
- Chromium: …
- Gecko: …
- WebKit: …
- Deno: …
- Node.js: …
- [ ] MDN issue is filed: …
- [ ] The top of this comment includes a clear commit message to use.
(See WHATWG Working Mode: Changes for more details.)
@jasnell hey, whats the holdup with this? is there anything we from Deno can do to push this forward? If you don't have time, I do not mind taking this over.
Gonna already explicitly confirm that Deno does have interest in having this.
Yeah time disappeared on me. Happy to hand it over if you have the cycles. I just had to push it down the priority stack and haven't been able to get back to it