package.loaders

Table of package loaders

Prototype

package.loaders

Description

This is a table of the loaders that Lua calls when handling the "require" function. As defined in the source code they are presently done in this order: You could conceivable alter the behaviour of the "require" function be re-odering the loaders (eg. load DLLs before Lua code), deleting a loader, or adding your own.

The existing loaders appear to push a string describing what files they failed to load (which you can see if you load a non-existant package), so any loaders you write yourself could return the loaded function on success, and an error string on failure.

Lua functions

Topics