A method for converting a Node.js-style asynchronous function into a function that returns a promise.