Effect CommunityEC
Effect Community3y ago
4 replies
leonitous

Converting NodeJs code to effect code for streaming file download and saving

Hey y'all,
I am trying to convert some NodeJs code to effect code where I download a file and save it to a folder using streams. I am wondering if the effect httpClient can stream a response to a file and if so what is the syntax? Here is what I've got so far:

const request = yield* _(effectHttpClient.pipe(Http.client.filterStatusOk)(Http.request.get(downloadUrl)));

request.stream.pipe(Stream.run(effectFs.sink(downloadsFolder)));
Was this page helpful?