Class: ModuleResolver

ModuleResolver(moduleSrc, cacheFile, moduleAnalyzer)

The module resolver will resolve modules and converts their inject information into a set of information, the objectManager needs in order to handle injection properly

Constructor

new ModuleResolver(moduleSrc, cacheFile, moduleAnalyzer)

Parameters:
Name Type Description
moduleSrc

An array with absolute paths to folders including modules to use for injection

cacheFile

A path to a json file, that should be used as a cache.

moduleAnalyzer
Author:
  • Wolfgang Felbermeier (@f3lang)
Source:

Methods

addModuleSrcDir(dir)

Add an additional source directory to the Module Resolver

Parameters:
Name Type Description
dir string

The directory to parse

Source:

fetchModule(modulePath) → {Promise.<any>}

Fetches the module information and puts them into the cache.

Parameters:
Name Type Description
modulePath

The path to the module. Has to be resolvable by require()

Source:
Returns:
Type
Promise.<any>

getModuleNames(regex) → {Array}

Retrieves a list of module names which match a regular expression

Parameters:
Name Type Description
regex RegExp
Source:
Returns:

An array of matched module names

Type
Array

getResolvedModules() → {Object|*}

Get the complete set of resolved modules

Source:
Returns:
Type
Object | *

processModule(modulePath, stat)

Fetches the module and handles caching.

Parameters:
Name Type Description
modulePath

The absolute path to the module source file

stat

The stat of the module file

Source:

writeCache()

Write the cache file.

Source: