lib/promised-node.js
function load(module) {
    var toTransform,
		transformedModule = {};

    if (typeof module === "string") {
        toTransform = require(module);
    } else {
        toTransform = module;
    }

    for (var item in toTransform) {
        // transform only sync/async methods to promiseable since having utility methods also promiseable
        // could do more harm than good.
        if (typeof toTransform[item] === "function" && isFunctionPromiseable( toTransform, item, toTransform[item] )) {
            transformedModule[item] = rebuildAsPromise( toTransform, item, toTransform[item] );
        } else {
			transformedModule[item] = toTransform[item];
		}
    }

    return transformedModule;
}
function load(module) {
    var toTransform,
		transformedModule = {};

    if (typeof module === "string") {
        toTransform = require(module);
    } else {
        toTransform = module;
    }

    for (var item in toTransform) {
        // transform only sync/async methods to promiseable since having utility methods also promiseable
        // could do more harm than good.
        if (typeof toTransform[item] === "function" && isFunctionPromiseable( toTransform, item, toTransform[item] )) {
            transformedModule[item] = rebuildAsPromise( toTransform, item, toTransform[item] );
        } else {
			transformedModule[item] = toTransform[item];
		}
    }

    return transformedModule;
}
function load ( module ) { var toTransform , transformedModule = { } ; if ( typeof module === "string" ) { toTransform = require ( module ) ; } else { toTransform = module ; } for ( var item in toTransform ) { // transform only sync/async methods to promiseable since having utility methods also promiseable // could do more harm than good. if ( typeof toTransform [ item ] === "function" && isFunctionPromiseable ( toTransform , item , toTransform [ item ] ) ) { transformedModule [ item ] = rebuildAsPromise ( toTransform , item , toTransform [ item ] ) ; } else { transformedModule [ item ] = toTransform [ item ] ; } } return transformedModule ; }
Load a module transforming all the async methods that have callbacks
into promises enabled functions.
@param {string|object} module The module name, or the object to transform its functions.
@return {object} Loaded module with methods transformed.
Load a module transforming all the async methods that have callbacks into promises enabled functions .