Answers for "node js request download file"

0

node js request download file

const http = require('http'); // or 'https' for https:// URLs
const fs = require('fs');

const file = fs.createWriteStream("file.jpg");
const request = http.get("http://i3.ytimg.com/vi/J---aiyznGQ/mqdefault.jpg", function(response) {
  response.pipe(file);
});
Posted by: Guest on April-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language