I'm new to nodejs. I’m not seeing the response in ex 1, but i see in ex 2. Why? Await works for me in other places, using babel.
Ex 1
let res = await request(url) console.log(res); console.log(res.body); Ex 2
request(url, function (error, res, body) { if (!error && response.statusCode == 200) { console.log(body) } }); Await works in other places, I’m using babel and required modules for es6 and es7 features. For example, await works in squelize call, i validated. But it doesn’t work for request call. Why?
async/awaitis not part of ES7. It's still only a proposal.