wiki/notebook/lang.lua.modules.org
2022-04-20 19:05:37 +08:00

627 B

Lua modules

  • for future references, this is documented from the Lua manual
  • to use the modules from lua, you can call require builtin; the require'd module are stored in a table packages.loaded and its content will be loaded inside of a function; the module will only load once and it will only cache the return value
  • to unload a module, you can set the package from the package table to null (i.e., nil)