Module:Station: Difference between revisions

From Nguhcraft Wiki
Jump to navigation Jump to search
Biangfox (talk | contribs)
No edit summary
Biangfox (talk | contribs)
No edit summary
Line 1: Line 1:
local p = {}
local p = {}


local data = mw.loadJsonData "Data:NguhRoutes/network.json"
-- Load JSON data
local data = mw.loadJsonData("Data:NguhRoutes/network.json")


p.yes = function( frame )
p.yes = function(frame)
return data
    -- Add error handling for JSON data
    if data == nil then
        return "Error: Failed to load JSON data from Data:NguhRoutes/network.json"
    end
    return data
end
end
-- CRITICAL: You must return the module table
return p

Revision as of 22:58, 8 January 2026

Documentation for this module may be created at Module:Station/doc

local p = {}

-- Load JSON data
local data = mw.loadJsonData("Data:NguhRoutes/network.json")

p.yes = function(frame)
    -- Add error handling for JSON data
    if data == nil then
        return "Error: Failed to load JSON data from Data:NguhRoutes/network.json"
    end
    return data
end

-- CRITICAL: You must return the module table
return p