Use bluebirds .from callback function to easily to await on a function that takes a callback).
This only works if your callbacks are called in the standard way though, ie (err, result).
const Promise = require('bluebird');
await Promise.fromCallback(callback => functionThatTakesACallback(arg1, arg2, callback));
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.