{"_id":"@chelproc/typeorm-to-drawio","_rev":"3-428bd825fef3cbb9843281bef55ec4be","name":"@chelproc/typeorm-to-drawio","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@chelproc/typeorm-to-drawio","version":"1.0.0","author":{"name":"chelproc"},"license":"MIT","_id":"@chelproc/typeorm-to-drawio@1.0.0","maintainers":[{"name":"chelproc","email":"chelproc@outlook.com"}],"homepage":"https://github.com/chelproc/typeorm-to-drawio#readme","bugs":{"url":"https://github.com/chelproc/typeorm-to-drawio/issues"},"bin":{"typeorm-to-drawio":"dist/main.js"},"dist":{"shasum":"e4780f1b5d206233838c3d1f847d6356f30396ea","tarball":"https://registry.npmjs.org/@chelproc/typeorm-to-drawio/-/typeorm-to-drawio-1.0.0.tgz","fileCount":16,"integrity":"sha512-tpj7OrFtoip6PpsfXMHFYT7DCz0Rcmal6XtAT28ZOdCpDVVHLwzEm6YxAmZ8PpdaIlFvZ6Zmb7YsDsA3bUx5hQ==","signatures":[{"sig":"MEYCIQDoOrQctsfslEsVMqNXnhCKqaHze67Izkuh9bi6IJJeRQIhAJLnaturnI1DsYCq1yl1EsqOVP8ea2W4XJJ6YopM4fpU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53865},"main":"./dist/main.js","type":"module","gitHead":"74aeab94aab6901d2586aa98baa81845303b171a","scripts":{"build":"tsc","start":"tsx src/main.ts"},"_npmUser":{"name":"chelproc","email":"chelproc@outlook.com"},"repository":{"url":"git+https://github.com/chelproc/typeorm-to-drawio.git","type":"git"},"_npmVersion":"10.9.2","description":"A CLI tool to generate Draw.io ER diagrams from TypeORM entities","directories":{},"_nodeVersion":"22.17.1","dependencies":{"xmlbuilder2":"^3.1.1","@babel/types":"^7.28.4","@babel/parser":"^7.28.4","@babel/traverse":"^7.28.4"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","typescript":"^5.9.3","@types/node":"^24.7.2","@types/babel__traverse":"^7.28.0"},"_npmOperationalInternal":{"tmp":"tmp/typeorm-to-drawio_1.0.0_1760338981968_0.7056237856228216","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@chelproc/typeorm-to-drawio","version":"1.0.2","author":{"name":"chelproc"},"license":"MIT","_id":"@chelproc/typeorm-to-drawio@1.0.2","maintainers":[{"name":"chelproc","email":"chelproc@outlook.com"}],"homepage":"https://github.com/chelproc/typeorm-to-drawio#readme","bugs":{"url":"https://github.com/chelproc/typeorm-to-drawio/issues"},"bin":{"typeorm-to-drawio":"dist/main.js"},"dist":{"shasum":"3ad2a1ded3337b3d15f930712fe10c77294765f2","tarball":"https://registry.npmjs.org/@chelproc/typeorm-to-drawio/-/typeorm-to-drawio-1.0.2.tgz","fileCount":14,"integrity":"sha512-f0gJQSBXgGS93lBzOl3UyDoFRRMCDfL6J4NRjVB2Mxc1iTfXjHIWlRGIsuGHTA/r/K/qQd9s/gXFWPTtJYJJBQ==","signatures":[{"sig":"MEQCIBuglAkSluKPKs0ByxMJDd6CtK2ORDiFvpmEo8XvbJQcAiAQKO0Jblu4nL0dlHLz6GE0TkUa2h76V30m5xSxBHPSqA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@chelproc%2ftypeorm-to-drawio@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":51488},"main":"./dist/main.js","type":"module","gitHead":"d5317f144a55b46851355d2ca23de5c3e16d9a32","scripts":{"build":"tsc","start":"tsx src/main.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:82a8d0d5-b582-4073-8f62-8c63b3b540d2"}},"repository":{"url":"git+https://github.com/chelproc/typeorm-to-drawio.git","type":"git"},"_npmVersion":"11.6.2","description":"A CLI tool to generate Draw.io ER diagrams from TypeORM entities","directories":{},"_nodeVersion":"22.20.0","dependencies":{"elkjs":"^0.11.0","xmlbuilder2":"^3.1.1","@babel/types":"^7.28.4","@babel/parser":"^7.28.4","@babel/traverse":"^7.28.4"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","typescript":"^5.9.3","@types/node":"^24.7.2","@types/babel__traverse":"^7.28.0"},"_npmOperationalInternal":{"tmp":"tmp/typeorm-to-drawio_1.0.2_1760342211899_0.9970447132918159","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@chelproc/typeorm-to-drawio","author":{"name":"chelproc"},"description":"A CLI tool to generate Draw.io ER diagrams from TypeORM entities","version":"1.0.3","license":"MIT","type":"module","main":"./dist/main.js","bin":{"typeorm-to-drawio":"dist/main.js"},"repository":{"type":"git","url":"git+https://github.com/chelproc/typeorm-to-drawio.git"},"publishConfig":{"access":"public","provenance":true},"scripts":{"build":"tsc","start":"tsx src/main.ts","prepublishOnly":"npm run build"},"dependencies":{"@babel/parser":"^7.28.4","@babel/traverse":"^7.28.4","@babel/types":"^7.28.4","elkjs":"^0.11.0","xmlbuilder2":"^3.1.1"},"devDependencies":{"@types/babel__traverse":"^7.28.0","@types/node":"^24.7.2","tsx":"^4.20.6","typescript":"^5.9.3"},"gitHead":"dd8c15e1caf11da99ec0522e83e1f2de1f8044ef","_id":"@chelproc/typeorm-to-drawio@1.0.3","bugs":{"url":"https://github.com/chelproc/typeorm-to-drawio/issues"},"homepage":"https://github.com/chelproc/typeorm-to-drawio#readme","_nodeVersion":"22.21.1","_npmVersion":"11.6.3","dist":{"integrity":"sha512-3yrrw9LhDxj6DsZoRGnzVzp0VCfSRaMW7eSV2LjK9485CgRHm2AxQbULwCdyS2YWKNwfJK8JjuDE+Zr3ttGblw==","shasum":"aff18c528561dc180d9fd829c863192d71fcade0","tarball":"https://registry.npmjs.org/@chelproc/typeorm-to-drawio/-/typeorm-to-drawio-1.0.3.tgz","fileCount":14,"unpackedSize":53241,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@chelproc%2ftypeorm-to-drawio@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCPCPMmptm0QRqIctTlszjw9qp8ax5wI/uV5Pea5mwQlAIhALuRpHm/0bUv2uxyfdXu/QtNkgrd+cYmXT+DjdbOeloC"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:82a8d0d5-b582-4073-8f62-8c63b3b540d2"}},"directories":{},"maintainers":[{"name":"chelproc","email":"chelproc@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typeorm-to-drawio_1.0.3_1763616064765_0.5243439176651872"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-13T07:03:01.863Z","modified":"2025-11-20T05:21:05.683Z","1.0.0":"2025-10-13T07:03:02.136Z","1.0.2":"2025-10-13T07:56:52.082Z","1.0.3":"2025-11-20T05:21:04.944Z"},"bugs":{"url":"https://github.com/chelproc/typeorm-to-drawio/issues"},"author":{"name":"chelproc"},"license":"MIT","homepage":"https://github.com/chelproc/typeorm-to-drawio#readme","repository":{"type":"git","url":"git+https://github.com/chelproc/typeorm-to-drawio.git"},"description":"A CLI tool to generate Draw.io ER diagrams from TypeORM entities","maintainers":[{"name":"chelproc","email":"chelproc@outlook.com"}],"readme":"# TypeORM to Draw.io ER Diagram Generator\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7%2B-blue)](https://www.typescriptlang.org/)\n[![Node.js](https://img.shields.io/badge/Node.js-22%2B-green)](https://nodejs.org/)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nA 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.\n\n## Features\n\n- 🚀 **Automatic ER Diagram Generation**: Converts TypeORM entities to Draw.io compatible XML format\n- 🔍 **Smart Relationship Detection**: Automatically identifies and visualizes relationships between entities\n- 📊 **Complete Field Mapping**: Includes all entity fields with type information and constraints\n- 🎨 **Professional Diagrams**: Generates clean, organized diagrams with proper ER notation\n- 📁 **Batch Processing**: Process multiple entity files at once using glob patterns\n- 🛠️ **TypeScript Native**: Full support for TypeScript decorators and type annotations\n- ⚡ **Modern Node.js**: Built with Node.js 22+ features for optimal performance\n\n## Prerequisites\n\n- Node.js 22.0.0 or higher\n- npm or yarn package manager\n- TypeScript 5.7 or higher (for project compilation)\n\n## Installation\n\n### Global Installation\n\n```bash\nnpm install -g @chelproc/typeorm-to-drawio\n```\n\n### Local Installation\n\nInstall as a development dependency in your project:\n\n```bash\nnpm install --save-dev @chelproc/typeorm-to-drawio\n```\n\n### From Source\n\nClone the repository and install dependencies:\n\n```bash\ngit clone https://github.com/chelproc/typeorm-to-drawio.git\ncd typeorm-to-drawio\nnpm install\nnpm run build\n```\n\n## Usage\n\n### Basic Usage\n\nAfter global installation, generate a diagram from your TypeORM entities:\n\n```bash\ntypeorm-to-drawio path/to/entities/*.ts\n```\n\nOr use with npx (without global installation):\n\n```bash\nnpx @chelproc/typeorm-to-drawio path/to/entities/*.ts\n```\n\n### Command Line Options\n\n```\nOptions:\n  -o, --output <file>  Output file path (default: entities.drawio)\n  -v, --verbose        Enable verbose output\n  -h, --help           Show help message\n```\n\n### Examples\n\nProcess a single entity file:\n\n```bash\ntypeorm-to-drawio models/User.ts\n```\n\nProcess multiple entity files:\n\n```bash\ntypeorm-to-drawio models/User.ts models/Post.ts -o diagram.drawio\n```\n\nProcess all entities in a directory:\n\n```bash\ntypeorm-to-drawio models/*.ts -o output/er-diagram.drawio\n```\n\nWith verbose output:\n\n```bash\ntypeorm-to-drawio models/**/*.entity.ts -v\n```\n\nUsing npx (without global installation):\n\n```bash\nnpx @chelproc/typeorm-to-drawio models/**/*.ts -o diagram.drawio\n```\n\n## Supported TypeORM Decorators\n\nThe tool recognizes and processes the following TypeORM decorators:\n\n### Entity Decorators\n\n- `@Entity()` - Marks a class as a database entity\n\n### Column Decorators\n\n- `@PrimaryGeneratedColumn()` - Primary key with auto-generation\n- `@PrimaryColumn()` - Primary key column\n- `@Column()` - Regular column with type and options\n- `@CreateDateColumn()` - Auto-generated creation timestamp\n- `@UpdateDateColumn()` - Auto-generated update timestamp\n\n### Relationship Decorators\n\n- `@ManyToOne()` - Many-to-one relationships\n- `@OneToMany()` - One-to-many relationships\n- `@OneToOne()` - One-to-one relationships\n- `@ManyToMany()` - Many-to-many relationships\n- `@JoinColumn()` - Specifies join column for relationships\n- `@JoinTable()` - Specifies join table for many-to-many relationships\n\n## Example\n\n### Input (TypeORM Entity)\n\n```typescript\n@Entity()\nexport class User {\n  @PrimaryGeneratedColumn(\"uuid\")\n  id: string;\n\n  @Column()\n  name: string;\n\n  @Column({ unique: true })\n  email: string;\n\n  @OneToMany(() => Post, (post) => post.author)\n  posts: Post[];\n\n  @ManyToOne(() => Organization, (org) => org.users)\n  organization: Organization;\n}\n```\n\n### Output (Draw.io Diagram)\n\nThe tool generates a Draw.io compatible XML file that renders as a professional ER diagram with:\n\n- Entity boxes with field listings\n- Primary keys marked with [PK]\n- Relationship lines with proper cardinality notation (1:1, 1:N, N:N)\n- Optional/nullable fields marked with \"?\"\n- Type information for each field\n\n## Project Structure\n\n```\ntypeorm-to-drawio/\n├── src/\n│   ├── main.ts                 # CLI entry point\n│   ├── parser.ts               # TypeScript AST parser\n│   ├── entity-extractor.ts     # Entity and field extraction\n│   ├── relationship-analyzer.ts # Relationship analysis\n│   ├── drawio-generator.ts     # Draw.io XML generation\n│   └── types.ts                # TypeScript type definitions\n├── package.json\n├── tsconfig.json\n└── README.md\n```\n","readmeFilename":"README.md"}