Constructor
new ModuleLoader(loadOpts)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
loadOpts |
ModuleLoaderOptions | default options to use when searching for mods. |
Members
(private, static) defaultLoadOptions :ModuleLoaderOptions
- Source:
The default loading options.
Type:
(private) _loadOpts :ModuleLoaderOptions
- Source:
The default options to use when searching for mods.
Type:
Mod
- Source:
The Mod class to use when creating new Mod instances. Can be overridden for testing, etc.
Methods
(private) added(modPath) → {Promise.<ModArray>}
- Source:
Finds user-added game components.
Parameters:
| Name | Type | Description |
|---|---|---|
modPath |
String | the path to the |
Returns:
The mods installed by the user.
- Type
- Promise.<ModArray>
all(opts) → {Promise.<ModArray>}
- Source:
- To Do:
-
- Test returning only `vanilla` or only `added`
Find all Factorio Mods installed.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
ModuleLoaderOptions | options to control searching for mods. |
Returns:
all mods installed.
- Type
- Promise.<ModArray>
enabled(modsopt, optsopt) → {Promise.<ModArray>}
- Source:
Find all Factorio Mods that are enabled.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
mods |
ModArray |
<optional> |
Optional The mods to filter. Defaults to searching for all mods. |
opts |
ModuleLoaderOptions |
<optional> |
options to control searching for mods. |
Returns:
all mods installed and enabled.
- Type
- Promise.<ModArray>
(private) parseOpts(opts) → {ModuleLoaderOptions}
- Source:
Merge the temporary options with the default options for this class instance and the global default options,
including processing dependent options (like factorioDataPath defaulting to factorioPath + "/data")
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
ModuleLoaderOptions | the current instance options |
Returns:
the merged options
- Type
- ModuleLoaderOptions
sortedDependencies(modsopt) → {Promise.<ModArray>}
- Source:
- See:
Sort Factorio mods, so mods with dependencies are loaded after the dependencies.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
mods |
ModArray |
<optional> |
Optional The mods to sort. Defaults to searching for all mods. |
Returns:
resolves to a sorted list of the given mods.
- Type
- Promise.<ModArray>
(private) vanilla(dataPath) → {Promise.<ModArray>}
- Source:
Finds the vanilla game components.
Parameters:
| Name | Type | Description |
|---|---|---|
dataPath |
String | the path to the |
Returns:
The "mods" shipped with the vanilla game.
- Type
- Promise.<ModArray>