如何将可写流写入无处?

时间:2021-07-11 22:14:33

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?

我真的不希望可写流在任何地方写入,我只是使用它,以便我的转换流的缓冲区不会被备份。如何将可写流写入空目的地?

1 个解决方案

#1


2  

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

你可以把它写到/ dev / null,这是一个npm包,用于https://www.npmjs.com/package/dev-null

#1


2  

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

你可以把它写到/ dev / null,这是一个npm包,用于https://www.npmjs.com/package/dev-null