hypixel skyblock
Dev icon This is a module documentation subpage for Module:MultiRequire.
It contains usage information, categories and other content that is not part of the original module page.

This module provides two functions function that makes calling require() and mw.loadData() multiple easy.

Dependent Module

Loading the module

To load this module and make its method available for use, Add this line of code to the start of your module:

require('Module:MultiRequire')

The described functions below will be able to be used as they are saved as global variables in the module this module was loaded in.

Alternatively, you can use this module using the code below by using Module:LoadLib.

local loadLib = require('Module:LoadLib')

_G = loadLib(_G, {
    { 'Module:MultiRequire' },
    -- Place any other modules to load in here...
})

Depending on the settings you used in loadLib(), the methods of this module may be available under their respective variables in the module this module was loaded in.

Return Values

This module returns two functions:

multiRequire

multiRequire(<module 1/modules>(any)<module 2>(any)...(any)<module N>(any))
Returns any values returned by require() are returned. If the input is a table, it returns a table of the loaded modules. If variable length arguments are used, it returns the unpacked values. It will throw an error if the module is not found or if there was an error in loading one of the requested modules.

Examples

loadDataMulti

multiRequire(<module 1/modules>(any)<module 2>(any)...(any)<module N>(any))
Works exactly the same as multiRequire(), but uses mw.loadData() instead internally.

Examples

Submodules

No submodules found for this page. Try purging the page or viewing all subpages.


See Also

Hypixel SkyBlock Wiki Standard Lua Libraries (hsw/stdll) v · d · e
Type Libraries
Module Loading Utilities
General Utilities
Meta Modules
Object-oriented
Caching