标签:create str erro buffer size style const function func
const stream = fs.createReadStream(‘<filepath>/example.pdf‘, {bufferSize: 64 * 1024}) stream.pipe(res); let had_error = false; stream.on(‘error‘, function(err){ had_error = true; }); stream.on(‘close‘, function(){ if (!had_error) fs.unlink(‘<filepath>/example.pdf‘); });
createReadStream().pipe() Callback
标签:create str erro buffer size style const function func
原文地址:http://www.cnblogs.com/yudis/p/7121924.html