Use of external modules
Lua searches for modules at the places defined in package.path. You can place your module anywhere you like by adapting the Lua script as follows:
package.path = package.path .. ";/path/to/my/module/mymodule.lua"
require "mymodule"
For the script to search for all the Lua modules in that directory change it to:
package.path = package.path .. ";/path/to/my/module/?.lua"
Be aware that the delimiter (semicolon by default) is configurable.