What is the difference between util.pump(streamA, streamB) and streamA.pipe(streamB)?

前端 未结 3 371
故里飘歌
故里飘歌 2021-01-12 22:10

The source code looks very similar: pump, pipe. Why would I use one instead of the other? Is one simply a better version of the other?

3条回答
  •  不思量自难忘°
    2021-01-12 22:37

    Stream.pipe is now the preferred method apparently since 0.3.x so try and use that when possible

    sources:

    https://groups.google.com/forum/?fromgroups#!topic/nodejs/FwdDQvAf4xM

    https://stackoverflow.com/a/4591335/424851

提交回复
热议问题