流传递
轻松管理多个流及其结束。
它使用和来管道并产生结果到回调。
例子
使用 child_process.spawn :
var streamPass = require ( 'stream-pass' ) , child_process = require ( 'child_process' ) ;
var pass = streamPass ( function ( results ) {
console . log ( 'stdout was: ' + results . stdout . toString ( ) ) ;
console . log ( '2nd line of stderr was: ' + results . stderr . toString ( ) . split ( / \n / ) [ 1 ] ) ;
} , [ 'stderr' , '
评论0
最新资源