src/util.js
function findModulePath(request, parent) {
  var mainScriptDir = path.dirname(Module._resolveFilename(request, parent));
  var resolvedModule = Module._resolveLookupPaths(request, parent);
  var paths = resolvedModule[1];
  for (var i = 0, PL = paths.length; i < PL; i++) {
    if (mainScriptDir.indexOf(paths[i]) === 0) {
      return path.join(paths[i], request.replace('/', path.sep));
    }
  }
  return null;
}
function findModulePath(request, parent) {
  var mainScriptDir = path.dirname(Module._resolveFilename(request, parent));
  var resolvedModule = Module._resolveLookupPaths(request, parent);
  var paths = resolvedModule[1];
  for (var i = 0, PL = paths.length; i < PL; i++) {
    if (mainScriptDir.indexOf(paths[i]) === 0) {
      return path.join(paths[i], request.replace('/', path.sep));
    }
  }
  return null;
}
function findModulePath ( request , parent ) { var mainScriptDir = path . dirname ( Module . _resolveFilename ( request , parent ) ) ; var resolvedModule = Module . _resolveLookupPaths ( request , parent ) ; var paths = resolvedModule [ 1 ] ; for ( var i = 0 , PL = paths . length ; i < PL ; i ++ ) { if ( mainScriptDir . indexOf ( paths [ i ] ) === 0 ) { return path . join ( paths [ i ] , request . replace ( '/' , path . sep ) ) ; } } return null ; }
Determines the path at which the requested module will be loaded given
the provided parent module.

@param {string} request The name of the module to be loaded.
@param {object} parent The module into which the requested module will be loaded.
Determines the path at which the requested module will be loaded given the provided parent module .