Skip to content

Transforms JSON to Plant UML to help visualize your JSON data.

Notifications You must be signed in to change notification settings

kgoodridge/json-to-plantuml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-to-plantuml

Transforms JSON to Plant UML to help visualize your JSON data.

Example JSON data

{
    "name": "Product",
    "properties": {
        "id": {
            "type": "number",
            "description": "Product identifier",
            "required": true
        },
        "name": {
            "description": "Name of the product",
            "type": "string",
            "required": true
        },
        "price": {
            "type": "number",
            "minimum": 0,
            "required": true
        },
        "tags": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    }
}

Example Plant UML output

alt text

As CMD line tool

Install

$ npm install -g json-to-plantuml

Run

$ echo '{"foo": "bar"}' | json-to-plantuml
$ json-to-plantuml -f .\data\albumdata.json

Piping to PlantUML to generate image

$ echo '{"foo": "bar"}' | json-to-plantuml | java -jar plantuml.jar -pipe > topo.png
$ json-to-plantuml -f .\data\albumdata.json | java -jar plantuml.jar -pipe > topo.png

gif

Install Dependencies to generate image

Java, Plant UML, GraphViz

Known to work with PlantUML following versions

plantuml-jar-lgpl-8048

plantuml-jar-lgpl-8049

As project dependency

Install

$ npm install --save json-to-plantuml

Code

var jsonToPlantUml = require('json-to-plantuml');

jsonToPlantUml('{"foo":"bar"}')
	.then(console.log)
	.catch(console.log);

Output

@startuml
class "root" as root {
    .. Properties ..
    foo: bar
}
@enduml

About

Transforms JSON to Plant UML to help visualize your JSON data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%