Skip to content

Instantly share code, notes, and snippets.

@sudosoul
Created May 16, 2018 04:16
Show Gist options
  • Save sudosoul/bd845fcb6a1dc5d8210c2fd6473db0e3 to your computer and use it in GitHub Desktop.
Save sudosoul/bd845fcb6a1dc5d8210c2fd6473db0e3 to your computer and use it in GitHub Desktop.
async away with npm request library
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