ky equivalent of got.stream ? #558
-
I am trying to migrate from remaining code to be migrated:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Ky does not currently support streaming, but you could use import {createWriteStream} from 'node:fs';
import {pipeline} from 'node:stream/promises';
const response = await fetch(url);
await pipeline(response.body, createWriteStream(tempFile)); |
Beta Was this translation helpful? Give feedback.
-
Streaming requests and responses are fully supported in the fetch spec and by Ky. However, browser support for streaming requests is somewhat spotty, but it's getting better. See: https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#browser_compatibility |
Beta Was this translation helpful? Give feedback.
Ky does not currently support streaming, but you could use
fetch
directly: