question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Bring your own stream"

See original GitHub issue

(Just a question for me to consider in future.)

Is it possible to allow users to bring their own stream implementation, thus satisfy demands from both node stream and web stream camps? We did exactly that during the node <1 era when Promise isn’t native yet. Perhaps it’s time for that again…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
jimmywartingcommented, Jul 23, 2021

NodeJS community have wanted to get fetch into core https://github.com/nodejs/node/issues/19393

…They listen and they are going for it. To ship it they need to implement many underlying methods such as Blob, AbortSignal, and many more like the whatwg stream that is part of fetch’s response.body first

So they added whatwg streams in node v16.5 as experimental: https://github.com/nodejs/node/pull/39062

we could shim it using a polyfill.

For ppl that still want/need a node:stream with .pipe() can do: stream.Readable.from(iterable_or_responseBody) or use the for await (let chunk of res.body).

Think we are still going to support uploading node:streams with Requests but the Body.body are going to return a speced whatwg:stream instead

1reaction
jimmywartingcommented, Jan 12, 2020

if https://github.com/whatwg/streams/issues/1018 gets implemented in both node and whatwg stream then maybe we can just keep the current stream that we are using.

Then they could use their own stream as they like.

res = await fetch(url)
ReadableStream.from(res.body)
Read more comments on GitHub >

github_iconTop Results From Across the Web

How To View Your Own Stream on Twitch - Alphr
Twitch Partners get to save VODs for 60 days before they vanish from existence. To watch your own VODs, you only have to...
Read more >
ReadableStreamBYOBReader - Web APIs - MDN Web Docs
First create the reader using ReadableStream.getReader() on the stream, specifying mode: "byob" in the options parameter. As this is a "Bring ...
Read more >
How to Start Streaming: Ultimate Guide - Restream
Creative streams take up a decent chunk of the live streaming ... Mixcloud: If you want to live stream music and DJ mixes...
Read more >
Would you watch your own stream? : r/Twitch - Reddit
A tip I've found helpful is asking myself: Would I watch my own stream? If you're struggling with growth, it's a good question…...
Read more >
Free Online Twitch Overlay Maker - Canva
1. Open up Canva and search for "Twitch Overlay." Decide on a design theme or focus for your Twitch overlay. Take note of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found