package.preload

A table of special function loaders

Prototype

package.preload

Description

A table of functions that can be used as loaders. If you want to make a special loader for your package you can insert it into the package.preload table. For example:

package.preload ["foo"] = function () print "loading foo" end
require "foo"  --> loading foo
In this example, when we required the package foo, the function was called.

Lua functions

Topics