erdia
TypeScript icon, indicating that this package has built-in type declarations

3.5.0 • Public • Published

ERDIA

erdia is create ER Diagram and Entity schema specification using by TypeORM and mermiad.js

ts Download Status Github Star Github Issues NPM version License ci codecov code style: prettier

Why erdia ?

erdia automatic generate DB entity specification, ER diagram. DB entity specification, ER diagram important document that are maintainence and develop process. But not so easy keep freshness. erdia help to easily keep freshness and easily generate beautiful document using ETA template engine.

Summary,

  1. ER diagram generate using mermaid.js syntax.
  2. Every document generate using ETA template engine
  3. Use TypeORM

Automate your database ER diagram drawing!

Table of Contents

Getting started

npm install erdia --save-dev
npx erdia init
npx erdia build

erdia support initialization command. And you execute build command.

How it works?

graph LR

A[TypeORM Entity] --> erdia
subgraph erdia
direction TB
C[TypeORM Entity]-->|extract <br/>entity specification|B[erdia]
end
erdia-->|extract <br />specification|D
D[ETA<br />template<br />engine]-->E[html]
D-->F[markdown]
D-->G[pdf]
D-->H[image]

Installation

installation

npm i erdia --save-dev

initialization

npx erdia init

Usage

erdia build -d [your dataSource path] -o dist/entity --format html

Requirement

  • TypeORM 0.3.x

Example

Showcase

erdia showcase

Documents

Output Format

erdia support html, markdown, pdf, svg, png. Database entity specification table only support html, markdown, pdf format.

# PDF document generate
erdia build -d [your dataSourcePath] -o dist/entity --format pdf

Template

erdia use ETA template for entity specification document and ER diagram. Template easily detach from erdia.

npx erdia eject

Detached template can change and every document customizable. The template can be found here.

TypeScript and Re-Map Paths

TS_NODE_PROJECT="./tsconfig.json" ts-node -r tsconfig-paths/register ./node_modules/.bin/erdia er -d [your dataSource path]

erdia load dataSource file using TypeORM module. If you use module resolution need additional parameter need for successfully execution. You have to pass tsconfig-paths/register. See ts-node paths and baseUrl section

Package Sidebar

Install

npm i erdia

Weekly Downloads

1,619

Version

3.5.0

License

MIT

Unpacked Size

357 kB

Total Files

5

Last publish

Collaborators

  • jooni