lubyk logo

Lubyk documentation

Autoload

This class creates a module table that will automatically call require to find new keys. This enables "load as needed" code. If the required code cannot be found, generates an error.

.new (prefix, tbl)

Declare a new table with autoloading feature. The prefix should reflect the path used to call require for missing elements. If the optional tbl is provided, this table will be used as starting content.

Global

You can enable autoload on the global namespace _G to require modules.

WARN You should not disable strict or nil values in global namespace will have a huge overhead (try to require code on every access).

.global ()

Activate autoloading for global environment _G (this method is slightly different then new and adapted for the global environment). By default, this uses strict (forbids using global nil values).

.strict (x)

This can be used to disable strict mode when autoload is enabled for global environment.