{"id":15492143,"url":"https://github.com/imjuni/erdia","last_synced_at":"2025-04-16T03:45:40.986Z","repository":{"id":48305295,"uuid":"450427874","full_name":"imjuni/erdia","owner":"imjuni","description":"CLI to generate mermaid.js ER diagram using TypeORM entity","archived":false,"fork":false,"pushed_at":"2024-04-12T15:31:48.000Z","size":4748,"stargazers_count":34,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T10:27:29.200Z","etag":null,"topics":["cli","er-diagram","er-diagrams","erdia","erdiagram","markdonwn","nodejs","orm","typeorm","typescript"],"latest_commit_sha":null,"homepage":"https://imjuni.github.io/erdia/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imjuni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-21T09:22:10.000Z","updated_at":"2024-10-13T03:40:18.000Z","dependencies_parsed_at":"2024-03-14T18:34:46.716Z","dependency_job_id":"b81fdd46-e830-4e95-b2fe-9cc44bf93a3a","html_url":"https://github.com/imjuni/erdia","commit_stats":{"total_commits":89,"total_committers":1,"mean_commits":89.0,"dds":0.0,"last_synced_commit":"54d4d435cae490fb93a1c58c09939d88c31a334c"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ferdia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ferdia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ferdia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Ferdia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjuni","download_url":"https://codeload.github.com/imjuni/erdia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249192203,"owners_count":21227747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","er-diagram","er-diagrams","erdia","erdiagram","markdonwn","nodejs","orm","typeorm","typescript"],"created_at":"2024-10-02T07:59:04.173Z","updated_at":"2025-04-16T03:45:40.955Z","avatar_url":"https://github.com/imjuni.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ERDIA\n\nerdia is create ER Diagram and Entity schema specification using by TypeORM and mermiad.js\n\n![ts](https://flat.badgen.net/badge/Built%20With/TypeScript/blue)\n[![Download Status](https://img.shields.io/npm/dw/erdia.svg)](https://npmcharts.com/compare/erdia?minimal=true)\n[![Github Star](https://img.shields.io/github/stars/imjuni/erdia.svg?style=popout)](https://github.com/imjuni/erdia)\n[![Github Issues](https://img.shields.io/github/issues-raw/imjuni/erdia.svg)](https://github.com/imjuni/erdia/issues)\n[![NPM version](https://img.shields.io/npm/v/erdia.svg)](https://www.npmjs.com/package/erdia)\n[![License](https://img.shields.io/npm/l/erdia.svg)](https://github.com/imjuni/erdia/blob/master/LICENSE)\n[![ci](https://github.com/imjuni/fast-maker/actions/workflows/ci.yml/badge.svg?branch=master\u0026style=flat-square)](https://github.com/imjuni/fast-maker/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/imjuni/fast-maker/branch/master/graph/badge.svg?token=YrUlnfDbso\u0026style=flat-square)](https://codecov.io/gh/imjuni/fast-maker)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nWhy `erdia` ?\n\n`erdia` is a cli tool that allows you to automatically generate DB specifications and ER diagram documents using TypeORM. It is very hard to be diligent about updating DB specifications and ER diagrams whenever code and DB changes. `erdia` automatically generates DB statement and ER diagram documents using information provided by TypeORM whenever the code changes. By automatically generating documents using TypeORM code, you can maintain the freshness of your documents with minimal effort.\n\nSummary,\n\n1. ER diagram generate using [mermaid.js](http://mermaid.js.org/) syntax.\n2. Every document generate using [ETA](https://eta.js.org/) template engine\n3. Use [TypeORM](https://typeorm.io/)\n\nAutomate your database ER diagram drawing!\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n\n- [How it works?](#how-it-works)\n- [Getting started](#getting-started)\n  - [Installation](#installation)\n  - [Confuguration](#confuguration)\n  - [Generation](#generation)\n- [Usage](#usage)\n  - [Commands](#commands)\n  - [CLI Options](#cli-options)\n- [Programming Interfaces](#programming-interfaces)\n  - [Interfaces](#interfaces)\n  - [Function Options](#function-options)\n- [Requirement](#requirement)\n- [Example](#example)\n  - [Showcase](#showcase)\n  - [Documents](#documents)\n- [Output Format](#output-format)\n- [Template](#template)\n- [TypeScript](#typescript)\n- [License](#license)\n- [References](#references)\n\n`erdia` support initialization command. And you execute `build` command.\n\n## How it works?\n\n```mermaid\ngraph LR\n\nA[TypeORM Entity] --\u003e erdia\nsubgraph erdia\ndirection TB\nC[TypeORM Entity]--\u003e|extract \u003cbr/\u003eentity specification|B[erdia]\nend\nerdia--\u003e|extract \u003cbr /\u003especification|D\nD[ETA\u003cbr /\u003etemplate\u003cbr /\u003eengine]--\u003eE[html]\nD--\u003eF[markdown]\nD--\u003eG[pdf]\nD--\u003eH[image]\n```\n\n## Getting started\n\n### Installation\n\n```bash\nnpm install erdia --save-dev\n```\n\n### Confuguration\n\n```bash\nnpx erdia init\n```\n\n### Generation\n\n```bash\nerdia build -d [your dataSource path] -o dist/entity --format html\n```\n\n## Usage\n\n### Commands\n\n`erdia` supports the `build`, `clean`, `init`, and `eject` commands.\n\n| Command | Description                                                 |\n| ------- | ----------------------------------------------------------- |\n| build   | Builds the erdiagram document.                              |\n| init    | Generates a configuration file for creating erdiagrams.     |\n| eject   | Generates a template document file for creating erdiagrams. |\n| clean   | Deletes the previously built erdiagram document.            |\n\n### CLI Options\n\n- [build options](./docs/DETAIL_BUILD_COMMAND_OPTION.md#build-command-cli-options)\n- init options\n- [eject options](./docs/DETAIL_EJECT_COMMAND_OPTION.md#eject-command-cli-options)\n- [clean options](./docs/DETAIL_CLEAN_COMMAND_OPTION.md#clean-command-cli-options)\n\n## Programming Interfaces\n\n### Interfaces\n\n| Command      | Description                                                 |\n| ------------ | ----------------------------------------------------------- |\n| building     | Builds the erdiagram document.                              |\n| initializing | Generates a configuration file for creating erdiagrams.     |\n| ejecting     | Generates a template document file for creating erdiagrams. |\n| cleaning     | Deletes the previously built erdiagram document.            |\n\n### Function Options\n\n- [build options](./docs/DETAIL_BUILD_COMMAND_OPTION.md#building-function-options)\n- init options\n- [eject options](./docs/DETAIL_EJECT_COMMAND_OPTION.md#eject-function-options)\n- [clean options](./docs/DETAIL_CLEAN_COMMAND_OPTION.md#clean-function-options)\n\n## Requirement\n\n- TypeORM 0.3.x\n\n## Example\n\n### Showcase\n\n![erdia showcase](./assets/erdia-showcase.gif)\n\n### Documents\n\n- [ER diagram html format](./assets/html/index.html)\n- [ER diagram png image format](./assets/erdiagram.png)\n- [ER diagram \u0026 table pdf format](./assets/erdiagram.pdf)\n\n## Output Format\n\n`erdia` support html, markdown, pdf, svg, png. Database entity specification table only support html, markdown, pdf format.\n\n```bash\n# PDF document generate\nerdia build -d [your dataSourcePath] -o dist/entity --format pdf\n```\n\n## Template\n\n`erdia` use ETA template for entity specification document and ER diagram. Template easily detach from erdia.\n\n```bash\nnpx erdia eject\n```\n\nDetached template can change and every document customizable. The template can be found [here](https://github.com/imjuni/erdia/tree/master/src/template).\n\n## TypeScript\n\nIf you are using TypeScript, you must use `ts-node` or `tsx` to run `erdia`. This is because the TypeORM Entity file is written in TypeScript.\n\n- [ts-node](./docs/DETAIL_TYPESCRIPT.md#ts-node)\n- [tsx](./docs/DETAIL_TYPESCRIPT.md#tsx)\n- [scripts](./docs/DETAIL_TYPESCRIPT.md#using-programming-interfaces)\n\n## License\n\nThis software is licensed under the [MIT](LICENSE).\n\n## References\n\n- [TypeORM](https://typeorm.io/)\n- [ER Diagram](https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Ferdia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjuni%2Ferdia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Ferdia/lists"}