-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Description
Node has some utilities for fully consuming streams (web or otherwise, though for some reason these are only documented in the webstreams docs page).
Specifically, it offers arrayBuffer
, blob
, buffer
, json
, and text
, intended to mirror the similar methods on the Body
mixin on the web (which is what provides these methods for e.g. fetch
responses).
Since then, the Body
mixin has gained a new bytes
method which gives you a Uint8Array. The same should be added here to match.
Note that there is still discussion of adding similar methods to web streams natively, but there's no firm implementer interest except from Bun. But if they eventually ship natively a bytes
method will beincluded.
This is probably a good first issue; the original PR plus the followup docs PR are pretty small.