
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@chelproc/typeorm-to-drawio
Advanced tools
A CLI tool to generate Draw.io ER diagrams from TypeORM entities
A powerful CLI tool that automatically generates Draw.io Entity-Relationship (ER) diagrams from TypeORM entity definitions in TypeScript. Transform your database schema code into visual diagrams with just one command.
npm install -g @chelproc/typeorm-to-drawio
Install as a development dependency in your project:
npm install --save-dev @chelproc/typeorm-to-drawio
Clone the repository and install dependencies:
git clone https://github.com/chelproc/typeorm-to-drawio.git
cd typeorm-to-drawio
npm install
npm run build
After global installation, generate a diagram from your TypeORM entities:
typeorm-to-drawio path/to/entities/*.ts
Or use with npx (without global installation):
npx @chelproc/typeorm-to-drawio path/to/entities/*.ts
Options:
-o, --output <file> Output file path (default: entities.drawio)
-v, --verbose Enable verbose output
-h, --help Show help message
Process a single entity file:
typeorm-to-drawio models/User.ts
Process multiple entity files:
typeorm-to-drawio models/User.ts models/Post.ts -o diagram.drawio
Process all entities in a directory:
typeorm-to-drawio models/*.ts -o output/er-diagram.drawio
With verbose output:
typeorm-to-drawio models/**/*.entity.ts -v
Using npx (without global installation):
npx @chelproc/typeorm-to-drawio models/**/*.ts -o diagram.drawio
The tool recognizes and processes the following TypeORM decorators:
@Entity() - Marks a class as a database entity@PrimaryGeneratedColumn() - Primary key with auto-generation@PrimaryColumn() - Primary key column@Column() - Regular column with type and options@CreateDateColumn() - Auto-generated creation timestamp@UpdateDateColumn() - Auto-generated update timestamp@ManyToOne() - Many-to-one relationships@OneToMany() - One-to-many relationships@OneToOne() - One-to-one relationships@ManyToMany() - Many-to-many relationships@JoinColumn() - Specifies join column for relationships@JoinTable() - Specifies join table for many-to-many relationships@Entity()
export class User {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column()
name: string;
@Column({ unique: true })
email: string;
@OneToMany(() => Post, (post) => post.author)
posts: Post[];
@ManyToOne(() => Organization, (org) => org.users)
organization: Organization;
}
The tool generates a Draw.io compatible XML file that renders as a professional ER diagram with:
typeorm-to-drawio/
├── src/
│ ├── main.ts # CLI entry point
│ ├── parser.ts # TypeScript AST parser
│ ├── entity-extractor.ts # Entity and field extraction
│ ├── relationship-analyzer.ts # Relationship analysis
│ ├── drawio-generator.ts # Draw.io XML generation
│ └── types.ts # TypeScript type definitions
├── package.json
├── tsconfig.json
└── README.md
FAQs
A CLI tool to generate Draw.io ER diagrams from TypeORM entities
We found that @chelproc/typeorm-to-drawio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.