News for hackers. Stuff that matters.
Re:Never Mix Promises and Callbacks in NodeJS by vkjv on Friday April 07, 2017 @12:25PM (#14061068)
You don't need to refactor the existing code. You can change the calling code.

    // Promisifying a standard callback
    const myAsyncMethod = Bluebird.promisify(myCallbackMethod);

    // Or if you have weird callback passing and need
    // to manipulate the callback method being passed around
    function myAsyncMethod(...args) {
        return Bluebird.fromCallback(cb => myAsyncMethod(cb, ...args));
    }

There are no comments on this comment yet.