You can wrap the callback-based function using the Promise constructor, resolving or rejecting the Promise based on the callback's outcome.
Promise.promisify()` is a utility to convert a callback-based function into a Promise-based function.
Takes a function following the common error-first callback style, i.e. taking a (err, value) => ... callback as the last argument, and returns a version that returns promises.