local module = {};

module.xxx = xxx;
functionn module.xxx ()
-- todo
end

return module;

Lua 模块被 require 之后, 只会运行一次并进行缓存