Q:

Assigning page results from scrape-it npm to a variable returns Promise {  }

I'm attempting to use scrape-it as a dependency that I downloaded from NPM earlier today. I'm able to get the content back that I want, but need to store the results in a variable rather than handle them via the callback.
Using the 'sample' from scrape-it docs, when I try the following: 
var myVar = scrapeIt("http://ionicabizau.net", {
    title: ".header h1"
  , desc: ".header h2"
  , avatar: {
        selector: ".header img"
      , attr: "src"
    }
}).then(page => {
    return page;
});

console.log(myVar);

I get the result: Promise { <pending> }
I've also tried using 'await' prior to calling the scrapeIt() function, but when I do that locally 'Unexpected identifier' syntax error in return.
Mind you, when I've tried this on the RunKit + npm site, it does work there, but it doesn't work for me locally. I've uninstalled and reinstalled the package, and it seems like I have all the necessary dependencies, so not sure what I'm doing wrong. :-\
While this obviously does touch on the asynchronous nature of javascript, the focal point of the question is to better understand interaction with promises.

A:

The scrapeIt method is asynchronous due to the async nature of the request module.
scrapeIt.scrapeHTML is sync, but it expects the HTML as a string.
So, as long you can get the HTML from somewhere, you can do something very similar to what you did:
var myVar = scrapeIt.scrapeHTML("<h1>Hello</h1>", {
    title: "h1"
});
console.log(myVar);
// { title: "h1" }

You can think of something async as something that you have to wait for (e.g. downloading the HTML of the page—that takes time). That's why there are callbacks and promises and so on.
scrapeIt("http://ionicabizau.net", {
    title: ".header h1"
  , desc: ".header h2"
  , avatar: {
        selector: ".header img"
      , attr: "src"
    }
}).then(myVar => {
   // Use myVar, only once it's ready
   // Once the page is downloaded and parsed
   // this function is triggered
   console.log(myVar)

   // Here you can do something with myVar
});

// At this point the page is not downloaded yet.

