I'm trying to save an image download with the request module. With this
request('http://google.com/images/logos/ps_logo2.png').pipe(fs.createWriteStream('doodle.png'));
It works fine. But I want to be able to do something else after the image has been completely downloaded. How can provide a callback function to fs.createWriteStream ?