I have a highland stream streaming strings. I want to consume it by an external library (in my case Amazon S3) and for its SDK I need a standard node Readable Stream.
Is there a way to transform a highland stream into a ReadStream out of the box ? Or do I have to transform it myself?
It seems that there is no built-in way to convert the highland stream to Node Stream (as per current highland docs).
But highland stream can be piped into Node.js stream.
So you could use a standard PassThrough stream to achieve this in 2 lines of code.
PassThrough stream is basically a repeater. It's a trivial implementation of a Transform stream (both Readable and Writable).
It will emit Strings or Buffers depending on objectMode flag.