jookshub / typeorm-uml

Generate a database UML diagram for Typeorm projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typeorm-uml 1.2.1

A command line tool to generate UML diagrams for Typeorm projects. It uses plantuml to render diagrams and outputs an URL to a diagram.

Instalation

Install this command as a development dependency to your project:

npm i -D typeorm-uml

Usage

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.

Synopsis

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.

Typescript

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

Example

typeorm/typescript-example

typeorm-uml --format=svg --monochrome

typeorm/typescript-example

Contribute

Want to help or have a suggestion? Open a new ticket and we can discuss it or submit a pull request.

License

MIT

About

Generate a database UML diagram for Typeorm projects.

License:MIT License


Languages

Language:TypeScript 98.5%Language:JavaScript 1.2%Language:Batchfile 0.3%