0.1.1 • Published 5 months ago

erd-generator v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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, or markdown.

Screenshot

CLI Example

Installation

npm install -g erd-generator

Use

Generate ERD for Sequelize (MySQL)

erd-gen --type sequelize --dialect mysql --dbHost localhost --dbUser root --dbPassword secret --dbName mydb --outputDir ./erd --format svg

Generate ERD for Sequelize (PostgreSQL)

erd-gen --type sequelize --dialect postgres --dbHost localhost --dbUser root --dbPassword secret --dbName mydb --outputDir ./erd --format md

Generate ERD for Mongoose

erd-gen --type mongoose --dbHost localhost --dbName mydb --outputDir ./erd --format png

Options

OptionDescriptionRequired
--typeSpecifies the ORM type: sequelize or mongooseYes
--dialectSpecifies the database type: mysql or postgresYes (if --type=sequelize)
--dbHostSpecifies the database hostYes
--dbUserSpecifies the database usernameNo
--dbPasswordSpecifies the database passwordNo
--dbNameSpecifies the database nameYes
--outputDirSpecifies the output directory for generated filesNo (default: ./erd)
--formatSpecifies the output format: svg, png, or mdNo (default: svg)

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.

License

This project is licensed under the MIT License.