Answer the question
In order to leave comments, you need to log in
I am writing a wrapper for the request module so that it returns a value using promise and async / await, where did I go wrong?
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> }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question