This is also built into Fetch. Maybe we could make an easier API for it though.
https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams
+1
What about .stream()?
馃憤 I like it.
I'd like to work on this. Already have been but it's slower going. I wouldn't mind if anyone else is working on it concurrently for some collaboration/merging of ideas as well.
Do you have any other features to add on besides the built-in readableStream and writableStream?
Hi. How's it going? If you don't mind, i'll make a PR this weekend.
@sindresorhus was the streaming API ever exposed?
@jdalrymple yes, we added the ability to pass a callback function that receives chunks and metadata about the download progress, which you can use for streaming purposes.
https://github.com/sindresorhus/ky#ondownloadprogress
In the future, we will likely also add the ability to get a ReadableStream for the response, as that is already built into fetch().
Ah! That's what I was looking for. So the response is currently not available to be returned as a readable stream.
Most helpful comment
This is also built into Fetch. Maybe we could make an easier API for it though.
https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams