1

I'm trying to achieve it using following code as mentioned in npm-request but I get

TypeError: Object #<WriteStream> has no method 'pause'

request('https://www.google.com.np/images/srpr/logo11w.png').pipe(fs.createWriteStream('doodle.pdf'));

Cant seem to figure out, could be because of async .. is there a sync way ?

JyotiChhetri
  • 289
  • 1
  • 7
  • 21

1 Answers1

0

What version of node are you using? I have used this code to test your problem and it works perfectly for me

var request = require('request');
var fs = require('fs');

request('https://www.google.com.np/images/srpr/logo11w.png').pipe(fs.createWriteStream('doodle.pdf'));
Philip O'Brien
  • 4,146
  • 10
  • 46
  • 96