-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
you asked to help maintain this library, so here are some thoughts:
- streams2 implementation, shouldn't be hard with
readable-stream
. - i don't like the type inferencing in
getBody
. prefer if it were like.pipe(cat.string())
,.pipe(cat.buffer())
, etc. by default,.pipe(cat())
should just return an array of all the things. developers should know the type of source stream and how they wish to consume the data. - delegate specific use-cases to other libraries. for example, if you want to concat to a string, just use raw-body (if we get .pipe support). overkill, but i don't feel like reimplementing the stream decoder stuff.
- add
cat(stream, callback)
, basically juststream.pipe(this)
callback(err, data)
- it's a callback, not an event listener, so imo it should haveerr
as the first argument. however,err
should always benull
since concat-stream should never have any errors (i get How to handle errors without err callback argument #6 (comment)) unless we decide to throw errors when there are crazy typing issues. we can do crazy stuff like checklistener.length
but i'm not a fan of that either.- don't re-emit data (Reemit chunks and events so we can pipe concat-streams! #11). it doesn't handle back pressure so it's a terrible idea. people should just pipe to both
cat-stream
and the final stream. yield stream.pipe(cat())
support. not sure how to do that yet - maybe duck type it into a promise.
Metadata
Metadata
Assignees
Labels
No labels