How to customize exporting to binary files?

For example, when using TMX for client development, the server only needs to obtain map terrain data, that is, output a length, width, and whether the points are walkable, and output them to a binary file. How to customize an export option?I am a newcomer, and I saw a similar question mentioned by someone before saying that Python can be used for implementation? Can you provide more detailed steps? What is the JavaScript script written below this address for?

You can extend Tiled with JavaScript, including the ability to add custom export formats. This is documented here: