Re: Streams — good implementations?

To close the loop on yesterday’s inquiry about recent trends and/or implementations around Streams brought up by @michaelfig.

Does anyone have fresh input on the topic? I’m inclined to revisit this, but it feels kind of a rabbit hole if I get into it again at this time.


It’s been a while since I dove in this topic, but Streams were all the buzz a couple of years back. Since then, they just faded into the backdrop (for me and on the mainstream).

I ended up exploring flyd

While my usual package vetting criteria (as little deps as possible) still applied at the time, but rollup was coming into play. And now I am seeing they are depending on ramda — ie not sure it ticks the same for me now and when I last used it.

It should be noted however, that part of the reason why they faded out imho is because of async function* generator() {} that is now mainstream on engines. But back in the day, there was the hype about something along the lines of fantasy-land implementations, that is may be worth some digging.

Update: Worth noting in follow up exchanges with @michaelfig that in fact { async *[Symbol.asyncIterator]() {…} } and for await … of were the current preference (likely related to tests for eventual-send, correct?)

Also worth mentioning is the emphasis placed on task queue optimizations by implementers — for instance Node.js shifting to bootstrapping async for shipping ES modules — which provide fine-tuned interoperability that can be leverage out-of-box compared to third-party abstractions that may/not be aligned to do so.

It is probably also fair to also mention RxJS as a completely different path (observables) which I am sure at some point I would have had more to add here. In all likelihood not what you want, but worth bringing up just in case.

Everyone has caught up on type definitions in the past two years — the reason why I dropped many packages back in the day — now apparently not an issue as long as they are doing proper generics (ie worth checking before buying).


Node.js WhatWG Streams or not

See 2018 summit thread


Oh… Just Came to Mind!

Disclaimer — The following was part of unfinished experimental work from olden times.

I explored a minimalistic approach on the topic. It was written in TypeScript to work with someday back (Node.js v10.5 apparently) --experimental-modules and rollup for cjs.

:ballot_box_with_check: I am cleaning up the repo to make it current with Node.js — done.

For now, here is the source, the MJS, the CJS and my frictionless tests but from much earlier days.


1 Like