mikeal/request — Issue #128: Get filesize of file piped to writeStream
Author: anthonywebb
Created: 2011-12-06 22:59:57+00:00
State: open

Hey, going off the example in the readme and trying to work with the file once it has been written. Can I do something like this? Or is there some callback that will fire once the request completes? Right now it is telling me the file doesnt exist.

request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'));
console.log(fs.statSync('doodle.png').size);