package.loaded

Type Table
Library package.*
Revision 2017.3060
Keywords package
See also require()

Overview

A table used by require() to control which modules are already loaded. When you require a module modname and package.loaded[modname] is not false, require() simply returns the value stored there.

Syntax

package.loaded

Example

local ui = require( "ui" )
print( package.loaded.ui )   --> table: 0x170f83d0
print( package.loaded.abc )  --> nil (package not loaded)