当前位置: 首页 > 后端技术 > Node.js

through2原理分析

时间:2023-04-03 17:42:41 Node.js

写在前面through2常用于处理节点流。如果你用过gulp,你一定对这个包不陌生,比如:gulp.task('rewrite',()=>{returngulp.src('./through/enter.txt').pipe(through2.obj(function(chunk,enc,callback){const{contents}=chunk;for(vari=0;i