nice-registry / package-stream

🚰 An endless stream of clean package data from the npm registry.
24 stars 9 forks source link

Use real streams #4

Open zeke opened 7 years ago

zeke commented 7 years ago

As @wmhilton noted:

Your module exports an EventEmitter, not a stream.... I'm really into using stream facilities at the moment, like mississippi, and since level-graph has a db.putStream() function, I am taking the changes-stream stream, piping it through a map function, piping that into the database.

I've had a hard time making sense of how to use streams. They are conceptually simple, but implementation is another story. The stream implementation/interface has changed three times in node. To make matters worse, node hipsters eschew the built-in node streams in favor of userland modules for reasons that I don't fully understand.

So.. if anyone wants to work on making this package expose the same (or similar) interface while using real streams under the hood, I would be delighted.

billiegoose commented 7 years ago

To make matters worse, node hipsters eschew the built-in node streams in favor of userland modules for reasons that I don't fully understand.

You're talking about pull-streams aren't you? (Because I don't think Tim-not-invented-here-Caswell's culvert has ever been used outside of js-git.)

Yeah... to make things worse I just learned that the Browser has its own (completely different) API for native streams, as far as I know only used in window.fetch. source: https://jakearchibald.com/2016/streams-ftw/

I get a strong sense that it's going to get worse before it gets better. 🤕