Node.js中的流(Stream)介绍

2020-06-17 06:54:55易采站长站整理

       form.on(‘part’, function (part) {
            part.pipe(res); //流式大法好:)
 
            part.on(‘error’, function (err) {
                console.log(err);
                messaging.setRequestDone(uniqueID);
                return res.end(err);
            });
        });
    });
});

参考

how to write node programs with streams: stream-handbook