async saveToFile(filePath)
Saves the current JSON data to a file.
Parameters:
filePath(string) – Path where the JSON should be written.
Returns:
Promise<void>
Example:
1await jm.saveToFile("./data.json");
Edge Cases:
- Overwrites the file if it already exists.
- Throws an error if the write operation fails.