I'm trying to download an image the way it's described in the readme. Here is my code:
request("https://www.google.com/images/google_favicon_128.png").pipe(fs.createWriteStream('google_favicon_128.png'))
The problem is that the file is always 0 bytes. If I download with the standard https library and handle the data and end events it works just fine. Is there something I'm doing wrong?
I tested a basic example using node v0.10.15 and the latest version of request (2.25.0):
var request = require('request');
var fs = require('fs');
request("https://www.google.com/images/google_favicon_128.png").pipe(fs.createWriteStream('google_favicon_128.png'));
It saved the file just fine. Could it be a permissions issue in the directory you are writing the file to?
What version of node & request are you using?