【github地址:https://github.com/ABCDdouyae...】through2-map将through2包的transformFunction参数封装为amap函数形式{wantStrings:true}将块输出为字符串而不是缓冲区。默认的objectModal为true。constmap=require('through2-map');constfs=require('fs');lettrucate=map({wantStrings:true},(chunk)=>{console.log(chunk);leta=chunk.replace(/[,:]/g,'?')返回一个;})fs.createReadStream('./test/1.txt').pipe(trucate).pipe(fs.createWriteStream('./test/2.txt'))map.ctor([options,]fn)类似于through2.ctormap.objCtor([options,]fn)和through2.ctor({objectMode:true},transformFunction)类似于through2-筛选。through2包的transformFunction参数以过滤函数的形式封装。API与through2-map相同。stream-spigot可读流生成器,用于测试并将一些惰性函数转换为简单的可读流,或创建可读流
