I'm trying to use an AJAX in an application using puppeteer.js. In puppeteer everything returns a promise so you can effectively use the await keyword before most actions to force it to wait. This is kind of crucial since I need certain things done in chronological order. However, let's say I have some vendor code that performs an AJAX request deeply nested inside a function. I want to somehow use that function and force the app to wait for a response before continuing. I basically want to use await keyword but with a custom function. I almost want the function to inherit from promise because or else I can't use it?