Instantly share code, notes, and snippets.

What would you like to do?
HTTPS requests using Node.js and async / await through the request-promise-native module
const rp = require("request-promise-native");
async function processData() {
try {
let response = await rp("");
if (response.length > 100) {
let response2 = await rp("");
console.log("Data: ", response2.substring(0,10));
} catch (error) {
console.log("Error: ", error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment