Utils.loadNamespace
Requires files and stores them in a namespace table.
Requires files and stores them in a namespace table.
Accepts a table of require paths: {“path/to/file_1”, “path/to/another/file_2”, “etc”}
Accepts a path to a directory of Lua files: “my_files/here”
Directory loading uses love.filesystem and requires LÖVE.
If namespace is omitted, modules are still required (side effect only) and this function returns nil.
namespace = Utils.loadNamespace( pathOrFiles, namespace )Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
pathOrFiles |
string|table | A directory path or a table of require paths |
namespace |
table | Table that will hold the required files |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
namespace |
table|nil | The namespace table |