erd-generator
v0.1.1
Published
A CLI tool to generate ER diagrams from ORM models or schemas
Maintainers
Readme
ERD Generator
ERD Generator is a CLI tool that generates Entity-Relationship Diagrams (ERD) for Sequelize and Mongoose models.
Features
- Supports Sequelize (MySQL, PostgreSQL) and Mongoose.
- Outputs diagrams in
svg,png, ormarkdown.
Screenshot

Installation
npm install -g erd-generatorUse
Generate ERD for Sequelize (MySQL)
erd-gen --type sequelize --dialect mysql --dbHost localhost --dbUser root --dbPassword secret --dbName mydb --outputDir ./erd --format svgGenerate ERD for Sequelize (PostgreSQL)
erd-gen --type sequelize --dialect postgres --dbHost localhost --dbUser root --dbPassword secret --dbName mydb --outputDir ./erd --format mdGenerate ERD for Mongoose
erd-gen --type mongoose --dbHost localhost --dbName mydb --outputDir ./erd --format pngOptions
| Option | Description | Required |
|-------------------|-----------------------------------------------------|------------------------------------|
| --type | Specifies the ORM type: sequelize or mongoose | Yes |
| --dialect | Specifies the database type: mysql or postgres | Yes (if --type=sequelize) |
| --dbHost | Specifies the database host | Yes |
| --dbUser | Specifies the database username | No
| --dbPassword | Specifies the database password | No
| --dbName | Specifies the database name | Yes |
| --outputDir | Specifies the output directory for generated files | No (default: ./erd) |
| --format | Specifies the output format: svg, png, or md | No (default: svg) |
Contributing
Contributions are welcome! Feel free to submit issues or pull requests.
License
This project is licensed under the MIT License.
