Given a function that accepts a Node-style callback,
fooFn(options, function callback(err, result) { ... });
you can promisify it (convert it to a promise-based function) like this:
function promiseFooFn(options) {
return new Promise((resolve, reject) =>
fooFn(options, (err, re...