Creates a complete export of all listening statistics and saves it as a
JSON file in the user's downloads folder. This function enables users to
backup their listening data, transfer it between devices, or use it for
external analysis.
The export process includes:
Retrieving the complete statistics dataset
Converting complex data structures for proper serialization
Generating a timestamped filename for uniqueness
Saving the formatted data to the user's downloads directory
The exported file contains all metrics, patterns, and listening history
in a well-structured JSON format.
Example
// Export statistics and show result to user constexported = awaitexportStatistics(); if (exported) { showSuccess("Statistics exported to Downloads folder"); } else { showError("Failed to export statistics"); }
Exports all statistics data to a JSON file
Creates a complete export of all listening statistics and saves it as a JSON file in the user's downloads folder. This function enables users to backup their listening data, transfer it between devices, or use it for external analysis.
The export process includes:
The exported file contains all metrics, patterns, and listening history in a well-structured JSON format.
Example
Source