, , async.
. , , , . :
, html , script , : <script src="abc.js" async></script>
(httpster)
"use strict";
const request = require('request');
const options1 = { url: 'http://localhost:3333/' }
const options2 = { url: 'http://localhost:3333/abc.js' }
let htmlData
request.get(options1)
.on('response', resp => resp.on('data', d => htmlData += d))
.on('end', () => {
let scripts;
request.get(options2)
.on('response', resp => resp.on('data', d => scripts += d))
.on('end', () => {
let allData = htmlData.toString() + scripts.toString();
console.log(allData);
})
.on('error', err => console.log(err))
})
.on('error', err => console.log(err))
. js- url, .