perak / extract-mongo-schema

Extract schema from Mongo database, including foreign keys
71 stars 22 forks source link

francescov1/convert input json #12

Closed francescov1 closed 4 years ago

francescov1 commented 4 years ago

First off thanks for this great tool, it's been super useful for me! Ran into a situation recently where I was generating a diagram based off a large amount of data, taking a substantial amount of time. I wanted to have both the JSON and HTML generated, as well as the ability to easily edit the JSON and then convert to HTML (I know this can be done by just going into the HTML file and changing the JSON but it's a bit nicer to do directly from the JSON file and convert).

This PR adds an extra CLI option called --inputJson (alias -i) which allows you to pass in a previously generated JSON file using this tool and convert it to HTML. I am also happy to add support for the reverse (pass HTML and convert to JSON) when I have a bit more time. This option is less useful since it's pretty quick to grab the JSON from the HTML file, but could still come in handy.

I whipped this together pretty quick so let me know if you want me to cleanup or change anything! :)

perak commented 4 years ago

Thank you and apologies for late response. Merging.