# Global Lua Module

When writing custom Edge rules with Edgelang, sometimes you need to call a custom Lua module, you can add this Lua module with the Global Lua Module.

Let's see how to add a global Lua module and reference it in Edgelang.

First click on Global Configuration.

Then click Global Lua Modules in the left navigation bar to go to the Global Lua Modules page.

On this page, the global Lua modules that already exist are listed, and we click New Lua Module to create a new one.

The following two methods are supported

  1. Fill in the Module name column with the name of the module to be referenced later, and fill in the lua code in the edit box of the Lua code column
  2. Click Select File to import the existing lua module directly, the module name is the file name by default

After editing and clicking save, the lua module will be automatically distributed to each node and can then be referenced in the edgelang code