Module:Json exporter

-- for accessing module data pages that can be loaded with mw.loadData -- thx to https://stackoverflow.com/a/75162119

return { dump_as_json = function(frame) local module_name = frame.args[0] local json_encode = mw.text.jsonEncode -- json_encode = require "Module:JSON".toJSON return json_encode(require(module_name)) end }