2013年10月30日更新
当基础资源完成写入时,可读Steam
会发出
close事件。
r.on('close', function(){ console.log('request finished downloading file');});但是,如果要赶快
fs完成将数据写入光盘的时间,则需要Writeable Stream
finish事件:
var w = fs.createWriteStream('/tmp/imageresize/'+x);request(options1).pipe(w);w.on('finish', function(){ console.log('file downloaded to ', '/tmp/imageresize/'+x);});


