TypeORM Markdown documents generator including ERD diagrams and comment descriptions
npm install typeorm-markdown


TypeORM markdown documents generator.
- Mermaid ERD diagrams
- Descriptions by JSDoc
- Separations by @namespace comments
If you want to see how markdown document being generated, visit below examples:
- Markdown Content: yiy0ung/typeorm-markdown/test/erd.md
- TypeORM Entity Class: yiy0ung/typeorm-markdown/test/entities
```
npm i -D typeorm-markdown
`
typeorm-markdown version 1.0.0
Usage: typeorm-markdown [options]
Options:
-v, --version Print the current version
-i, --input
-o, --output
-t, --title
--project
-h, --help display help for command
`
This package is inspired by prisma-markdown, so it has similar usage.
- @namespace @namespace
- Both ERD and markdown content
- If is not set, it will be classified into the Default namespace.@erd
- : Only ERD@describe
- : Only markdown content, without ERD@hidden
- : Neither ERD nor markdown content
`typescript
/**
* Both description and ERD on User chapter.
* Also, only ERD on Blog chapter.
*
* @namespace User
* @erd Blog
*/
@Entity()
class User {}
/**
* Only description on User chapter.
*
* @describe User
*/
@Entity()
class UserProfile {}
/**
* Only erd on Blog chapter.
*
* @erd Blog
*/
@Entity()
class BlogPost {}
/**
* Never be shown.
*
* @hidden
*/
@Entity()
class BlogPostHit {}
`
typeorm-markdown` will generate markdown as specified in the ORM, so any columns that are auto-generated by TypeORM (such as fk columns) cannot be reflected in the markdown documents.
Therefore, it is recommended to write N:M tables and fk columns specifically in the ORM.