A command line tool to generate UML diagrams for Typeorm projects. It uses plantuml to render diagrams and outputs an URL to a diagram.
Install this command as a development dependency to your project:
npm i -D typeorm-uml
Add a new script to your package.json
to be able to run it:
{
"name": "myproject",
"scripts": {
"db:diagram": "typeorm-uml ormconfig.json"
}
}
Then run npm run db:diagram
and you will receive an URL to an image with your diagram. You can use this URL to add to your README file or you can download the image and add it to your repository.
USAGE
$ typeorm-uml [CONFIGNAME]
ARGUMENTS
CONFIGNAME [default: ormconfig.json] Path to the Typeorm config file.
OPTIONS
-c, --connection=connection [default: default] The connection name.
-d, --download=download The filename where to download the diagram.
-e, --exclude=exclude Comma-separated list of entities to exclude from the diagram.
-f, --format=png|svg|txt|puml [default: png] The diagram file format.
-i, --include=include Comma-separated list of entities to include into the diagram.
--monochrome Whether or not to use monochrome colors.
If you use .ts
entities in your Typeorm config, then run this command with ts-node
like this:
ts-node ./node_modules/.bin/typeorm-uml ormconfig.json
typeorm-uml --format=svg --monochrome
Want to help or have a suggestion? Open a new ticket and we can discuss it or submit a pull request.
MIT