 cache =
   dependencies: {}
   folders: {}
+  ranges: {}
 
 loadDependencies = (modulePath, rootPath, rootMetadata, moduleCache) ->
   nodeModulesPath = path.join(modulePath, 'node_modules')


  nodeModulesPath = path.join(modulePath, 'node_modules')
  dependencies = JSON.parse(fs.readFileSync(metadataPath))?.dependencies ? {}

  onDirectory = (childPath) ->
    path.basename(childPath) isnt 'node_modules'


  folderPath = path.dirname(parentModule.id)

  range = cache.folders[folderPath]?[relativePath]
  return unless range?

  candidates = cache.dependencies[relativePath]
  return unless candidates?

  for version, resolvedPath of candidates
    if Module._cache[resolvedPath] and satisfies(version, range)
      return resolvedPath

  undefined
