require

Name

require – get the Lua table provided by another mod

Synopsis

M = require(mod_name)

Description

This returns the namespace table of the given mod (i.e., the table containing all the values exported by that mod).

Errors

If no module of the given name has been registered yet, then an error is raised.

An error also occurs if argument 1 is not a string.

Notes

This is basically the same as mod.GetRegisteredMod, except that the behaviour when the mod is not found is different – mod.GetRegisteredMod returns nil in that case, whereas require throws an error.

See Also

mod.GetRegisteredMod

mod.RegisterMod