How to output czml

I want to output CZML displayed in cesium to a file.

Please tell me how to achieve


How was the CZML loaded in? If you already have a JSON string of it, you can just output that to a file. There’s nothing special about this for CesiumJS, you can do this directly with JavaScript, like in this answer:

I’m sorry.
I was trying to get it from CZMLDataSource, but I should use JSON.
Thank you