package.loaded

Type Table
Library package.*
Revision Release 2022.3683
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)