Guest User

Untitled

a guest
Jul 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. request(options, function (error, response, body) {
  2. if (error) throw new Error(error);
  3. fs.writeFile('./file1.pdf', body, 'binary', function (err) {
  4. if (err) throw err;
  5. console.log('Saved!');
  6. });
  7. console.log(body);
  8. }).pipe(fs.createWriteStream('./file2.pdf'));
Add Comment
Please, Sign In to add comment