Jump to content

Dump.JSONTable

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (dump.JSONTable – created via PowerShell script (2025-11-11T21:12:49Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: dump.JSONTable
Function Description: Dumps a table to a specified file in JSON format, ensuring proper serialization and directory creation. Handles nested tables, strings, numbers, and user data while skipping functions and userdata. Validates input and logs errors if necessary.
File Location: cmm.tools.lua
Syntax: CMM.dump.JSONTable( table TBL , string or nil FullPath )
Return Value: nil
Parameters: Name Description
TBLTable to be serialized and written to a file. Must be a valid table structure with supported data types.
FullPathFull file path where the JSON file will be saved. If invalid or missing, defaults to CMM.dump.Directory.
Example: CMM.dump.JSONTable(CMM, "C:\test123\file.json")
Example Description: Demonstrates dumping the CMM table to a JSON file located at C:\test123\file.json, ensuring proper directory creation and formatted output.
Related Functions:
Notes: