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

普通的耗时函数写成promises

时间:2023-04-03 14:54:56 Node.js

异步函数转为promise.fromStream(fileStream,{headers:true}).on('data',(data)=>{allDatas.push(data);}).on('end',async()=>{result(allDatas);});});}