Module:FileExists

return function(file_name) local success, result = pcall(function(file) return mw.title.new(file).fileExists end, file_name) return (success and result) end