Ky: Stream API

Created on 4 Sep 2018  路  9Comments  路  Source: sindresorhus/ky

enhancement help wanted

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

All 9 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

popuguytheparrot picture popuguytheparrot  路  6Comments

sarneeh picture sarneeh  路  6Comments

nnals picture nnals  路  4Comments

kraniebrud picture kraniebrud  路  3Comments

ShivamJoker picture ShivamJoker  路  5Comments