Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a writable stream write to nowhere?

My issue here is that I have a stream pipeline set up like.

readableStream.pipe(transformStream).pipe(writableStream);

I don't really want the writable stream to write anywhere, I'm just using it so that the buffer of my transform stream doesn't get backed up. How could I make the writable stream write to an empty destination?

like image 356
RadleyMith Avatar asked Sep 26 '22 20:09

RadleyMith


1 Answers

You can write it to /dev/null, there's an npm package for that https://www.npmjs.com/package/dev-null

like image 144
Yuri Zarubin Avatar answered Oct 11 '22 04:10

Yuri Zarubin