lib/expose.js
function importModule(module, scope, fn) {
    debug("Importing module: " + module);

    var imports = require(module),
        name = path.basename(module, path.extname(module));

    if (isPlainObject(imports)) {
        var keys = Object.keys(imports), key, len = keys.length;
        for (var i = 0; i < len; i++) {
            key = keys[i];
            if (imports.hasOwnProperty(key)) {
                scope[key] = imports[key];
                if (fn) {
                    fn(name, key, imports[key]);
                }
            }
        }
    } else {
        scope[name] = imports;
        if (fn) {
            fn(name, null, imports);
        }
    }
}
function importModule(module, scope, fn) {
    debug("Importing module: " + module);

    var imports = require(module),
        name = path.basename(module, path.extname(module));

    if (isPlainObject(imports)) {
        var keys = Object.keys(imports), key, len = keys.length;
        for (var i = 0; i < len; i++) {
            key = keys[i];
            if (imports.hasOwnProperty(key)) {
                scope[key] = imports[key];
                if (fn) {
                    fn(name, key, imports[key]);
                }
            }
        }
    } else {
        scope[name] = imports;
        if (fn) {
            fn(name, null, imports);
        }
    }
}
function importModule ( module , scope , fn ) { debug ( "Importing module: " + module ) ; var imports = require ( module ) , name = path . basename ( module , path . extname ( module ) ) ; if ( isPlainObject ( imports ) ) { var keys = Object . keys ( imports ) , key , len = keys . length ; for ( var i = 0 ; i < len ; i ++ ) { key = keys [ i ] ; if ( imports . hasOwnProperty ( key ) ) { scope [ key ] = imports [ key ] ; if ( fn ) { fn ( name , key , imports [ key ] ) ; } } } } else { scope [ name ] = imports ; if ( fn ) { fn ( name , null , imports ) ; } } }
Import a module into the given scope there by
`require`ing the module and copying its exports
into the given scope object.

@param {String} module The path to the module to require.
@param {Object} scope The namespace to import the modules exports into.
@param {Function} fn The optional callback function to invoke for each imported property.
@api private
Import a module into the given scope there by require ing the module and copying its exports into the given scope object .