Skip to content

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);

This comment has been minimized.

Copy link

@karthikkoruvada09 karthikkoruvada09 commented Apr 8, 2019

while trying to install that is saying no such module exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.