Module:Existsmod

-- Checks if a module exists (not an expensive call) -- Syntax : -- →--

local p = {}

function p.module_exists(inputData) local name = "" if type(inputData)=="table" and inputData.args then name = inputData.args[1] or inputData.args.name if inputData.getParent then local parent = inputData.getParent name = parent.args[1] or parent.args.name end end if type (inputData) == "string" then name = inputData end if not name:match(":") then name = "Module:"..name end if package.loaded[name] then return true else for _, searcher in ipairs(package.searchers or package.loaders) do     local loader = searcher(name) if type(loader) == 'function' then return true end end return false end end

function p.main(frame) return p.module_exists(frame) end

return p