I need to generate a specific JSON from a state diagram. I am currently working on a parser using Peggy in javascript, but I'm wondering if there is a way to get a state diagram as code, so I can manipulate the objects and the data to create the JSON that way, or any other format really, that is not an image. I am aware of a few js projects that aim to parse the UML text, like Enteee/plantuml-parser, but none support state diagrams yet.