var request = require('request');
console.log((async function(){
return await new Promise(function(res,rej){
request('http://toster.ru', function(e,r){
if(e) rej(e);
else res(r);
});
});
})());
C:\>node test
Promise { <pending> }
var request = require('request');
(async function() {
console.log(await new Promise(
function(res,rej){
request('http://toster.ru', function(e,r) {
if(e) rej(e);
else res(r);
});
}));
})();