I want to assign the content of the site acquired by specifying by URL to a variable.
Source
request-sample.js
var request = require('request');
var html = '';
request('https://www.google.com', function(error, response, body) {
html = body;
});
// Below, proceed with processing using saved contents
console.log(html);
Result
$ node request-sample.js
$
(Nothing is output...)
How can I solve it?