Does a trick like this exist for lua modules?

You can do whatever you want in the required file. You can declare global functions in the required file. There is no requirement to return a table with the functions.

-- mymodule.lua
function greet(name)
    print("Hello", name)
end
require("mymodule")
greet("Bob") -- Hello Bob
2 Likes