This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function will return a promise that will fetch data from a certain URL | |
function getURLPromise(url) { | |
return new Promise((resolve, reject) => { | |
http.get(url, (rs) => { | |
var data = '' | |
rs.on('data', (chunk) => data += chunk); | |
rs.on('end', ()=> resolve(data.length)); | |
}); | |
}); |
NewerOlder