package.searchpath

require looks in both the Lua module and extension path, which are package.path and package.cpath respectively. Sometimes it is very useful to know where a particular module will be found by Lua, without having to redo the module search logic. package.searchpath takes the module name (as understood by require) and a string representing the path to be searched:

> =  package.searchpath ('lfs',package.cpath)
/usr/local/lib/lua/5.2/lfs.so
> = package.searchpath ('test.mod', package.path)
./test/mod.lua