MCQs > IT & Programming > Node.js > What does the following code do? var http = require('http'); var fs = require('fs'); var file = fs.createWriteStream('file.png'); var request = http.get('http://path/to/file.png', function(response) { response.pipe(file); });

Node.js MCQs

What does the following code do?

var http = require('http');

var fs = require('fs');

var file = fs.createWriteStream("file.png");

var request = http.get("http://path/to/file.png",

function(response) { response.pipe(file); });

Answer

Correct Answer: It creates an HTTP GET request and pipes its response into a writeable file stream.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it