[英]Piping to a stream that needs to be both readable and writable
I'd like to be able to pipe from the src
stream to the something
stream. 我希望能够从
src
流传输到something
流。 I understand that something
needs to be a writable stream, as it's being piped to, however, it needs to also be a readable stream, so that it can pipe to somethingElse'. What should
我知道
something
必须通过管道传递到可写流,但是,它也必须是可读流,以便可以通过管道传递到somethingElse'. What should
somethingElse'. What should
something` return in order to make this work? 为了使这项工作有效,
somethingElse'. What should
返回些什么?
example.task('taskOne', function() {
return example
.src('pathName')
.pipe(something())
.pipe(somethingElse())
});
Solved! 解决了!
Made use of node modules through2
which solves this exact issue. 通过使用节点模块
through2
解决了这个确切的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.