Created
May 16, 2018 04:16
-
-
Save sudosoul/bd845fcb6a1dc5d8210c2fd6473db0e3 to your computer and use it in GitHub Desktop.
async away with npm request library
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
const Request = require('request'); | |
async function r() { | |
return new Promise((resolve, reject) => { | |
Request('https://google.com', (err, res, body) => { | |
resolve(body); | |
}); | |
}); | |
} | |
(async () => { | |
const res = await r(); | |
console.log(res); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment