The enchanting power of Bluebird promises meets the chaotic nature of request
, a function masquerading as an object with methods.
In this straightforward scenario, I find myself with a request instance equipped with cookies via a cookie jar (bypassing request
's global cookie handler). How can I seamlessly promisify it along with all its supported methods?
My ultimate goal is to:
- invoke
request(url)
-> Promise - invoke
request.getAsync(url)
-> Promise - invoke
request.postAsync(url, {})
-> Promise
It appears that Promise.promisifyAll(request)
falls short (resulting in "postAsync is not defined").