{"id":22840900,"url":"https://github.com/mkloubert/node-entity-baker","last_synced_at":"2025-08-11T15:23:41.890Z","repository":{"id":57225692,"uuid":"117424128","full_name":"mkloubert/node-entity-baker","owner":"mkloubert","description":"Generates simple and powerful entity classes for ORM systems, like Doctrine and/or Entity Framework.","archived":false,"fork":false,"pushed_at":"2018-01-26T04:29:06.000Z","size":79,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-27T16:57:59.327Z","etag":null,"topics":["csharp","database","doctrine","entity-framework","entity-framework-core","nodejs-modules","orm","php"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkloubert.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}},"created_at":"2018-01-14T11:25:53.000Z","updated_at":"2018-12-14T20:58:35.000Z","dependencies_parsed_at":"2022-08-24T11:00:31.519Z","dependency_job_id":null,"html_url":"https://github.com/mkloubert/node-entity-baker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mkloubert/node-entity-baker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkloubert%2Fnode-entity-baker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkloubert%2Fnode-entity-baker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkloubert%2Fnode-entity-baker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkloubert%2Fnode-entity-baker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkloubert","download_url":"https://codeload.github.com/mkloubert/node-entity-baker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkloubert%2Fnode-entity-baker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269911269,"owners_count":24495096,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csharp","database","doctrine","entity-framework","entity-framework-core","nodejs-modules","orm","php"],"created_at":"2024-12-13T01:14:00.500Z","updated_at":"2025-08-11T15:23:41.870Z","avatar_url":"https://github.com/mkloubert.png","language":"TypeScript","funding_links":["https://paypal.me/MarcelKloubert"],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/entity-baker.svg)](https://www.npmjs.com/package/entity-baker)\n[![npm](https://img.shields.io/npm/dt/entity-baker.svg?label=npm%20downloads)](https://www.npmjs.com/package/entity-baker)\n\n# node-entity-baker\n\n[Node.js](https://nodejs.org) application / library, which generates simple and powerful entity classes for [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping) systems, like [Doctrine](http://www.doctrine-project.org) and/or [Entity Framework](https://docs.microsoft.com/en-us/ef/), wriiten in [TypeScript](https://www.typescriptlang.org).\n\n## Installation\n\nAs command line tool:\n\n```bash\nnpm install -g entity-baker\n```\n\nAs module:\n\n```bash\nnpm install --save entity-baker\n```\n\n## Usage\n\nFirst create a `entities.json` file inside your working directory (can also be in XML or YAML format, s. [examples folder](https://github.com/mkloubert/node-entity-baker/tree/master/examples)):\n\n```json\n{\n    \"namespace\": \"MarcelJoachimKloubert.Database\",\n\n    \"entities\": {\n        \"Log\": {\n            \"table\": \"logs\",\n\n            \"columns\": {\n                \"id\": {\n                    \"id\": true,\n                    \"auto\": true,\n                    \"type\": \"int32\"\n                },\n                \n                \"level\": {\n                    \"null\": true,\n                    \"type\": \"int16\"\n                },\n                \n                \"message\": \"string\",\n                \"tag\": {\n                    \"null\": true,\n                    \"type\": \"string\"\n                },\n                \n                \"context\": {\n                    \"null\": true,\n                    \"type\": \"json\"\n                }\n            }\n        }\n    }\n}\n```\n\n### From command line\n\n```bash\n# run it from your working directory\nentity-baker --doctrine --entity-framework --entity-framework-core\n```\n\n### As module\n\nJavaScript\n\n```javascript\nvar EntityBaker = require('entity-baker');\n```\n\nTypeScript\n\n```typescript\nimport * as EntityBaker from 'entity-baker';\n```\n\n#### compile\n\n```javascript\nvar fs = require('fs');\n\nvar entityFile = JSON.parse(\n    fs.readFileSync('./entities.json', 'utf8')\n);\n\nEntityBaker.compile({\n    cwd: '/path/to/working/directory',\n    file: entityFile,\n    outDir: '/path/to/output/directory',\n       target: 1,  // Doctrine\n    // target: 2  // Entity Framework\n    // target: 3  // Entity Framework Core\n\n    callbacks: {\n        onBeforeGenerateClass: function(className, target) {\n        },\n\n        onClassGenerated: function(err, className, target) {\n        }\n    }\n}).then(function() {\n    // files generated\n}, function (err) {\n    // error while generating files\n});\n```\n\n## Data types\n\nType | [Doctrine]() | [Entity Framework]()\n------------ | ------------- | -------------\n`bigint` | [bigint](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#bigint) | [System.Int64](https://msdn.microsoft.com/en-us/library/system.int64(v=vs.110).aspx) |\n`bin` | [binary](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#binary) | [System.Byte\\[\\]](https://msdn.microsoft.com/en-us/library/system.byte(v=vs.110).aspx) |\n`binary` | [binary](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#binary) | [System.Byte\\[\\]](https://msdn.microsoft.com/en-us/library/system.byte(v=vs.110).aspx) |\n`blob` | [blob](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#blob) | [System.Byte\\[\\]](https://msdn.microsoft.com/en-us/library/system.byte(v=vs.110).aspx) |\n`bool` | [boolean](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#boolean) | [System.Boolean](https://msdn.microsoft.com/en-us/library/system.boolean(v=vs.110).aspx) |\n`boolean` | [boolean](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#boolean) | [System.Boolean](https://msdn.microsoft.com/en-us/library/system.boolean(v=vs.110).aspx) |\n`date` | [date](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#date) | [System.Int64](https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx) |\n`datetime` | [datetime](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#datetime) | [System.Int64](https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx) |\n`datetimetz` | [datetimetz](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#datetimetz) | [System.DateTimeOffset](https://msdn.microsoft.com/en-us/library/system.datetimeoffset(v=vs.110).aspx) |\n`decimal` | [decimal](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#decimal) | [System.Decimal](https://msdn.microsoft.com/en-us/library/system.decimal(v=vs.110).aspx) |\n`float` | [float](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#float) | [System.Single](https://msdn.microsoft.com/en-us/library/system.single(v=vs.110).aspx) |\n`guid` | [guid](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#guid) | [System.Guid](https://msdn.microsoft.com/en-us/library/system.guid(v=vs.110).aspx) |\n`int` | [integer](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#integer) | [System.Int32](https://msdn.microsoft.com/en-us/library/system.int32(v=vs.110).aspx) |\n`int16` | [smallint](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#smallint) | [System.Int16](https://msdn.microsoft.com/en-us/library/system.int16(v=vs.110).aspx) |\n`int32` | [integer](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#integer) | [System.Int32](https://msdn.microsoft.com/en-us/library/system.int32(v=vs.110).aspx) |\n`int64` | [bigint](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#bigint) | [System.Int64](https://msdn.microsoft.com/en-us/library/system.int64(v=vs.110).aspx) |\n`integer` | [integer](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#integer) | [System.Int32](https://msdn.microsoft.com/en-us/library/system.int32(v=vs.110).aspx) |\n`json` | [json](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#json) | [dynamic](https://msdn.microsoft.com/en-us/library/system.object(v=vs.110).aspx) |\n`smallint` | [smallint](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#smallint) | [System.Int16](https://msdn.microsoft.com/en-us/library/system.int16(v=vs.110).aspx) |\n`str` | [string](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#string) | [System.String](https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx) |\n`string` | [string](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#string) | [System.String](https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx) |\n`text` | [text](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#text) | [System.String](https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx) |\n`time` | [time](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#time) | [System.TimeSpan](https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx) |\n`uint16` | [smallint](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#smallint) | [System.UInt16](https://msdn.microsoft.com/en-us/library/system.uint16(v=vs.110).aspx) |\n`uint32` | [integer](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#integer) | [System.UInt32](https://msdn.microsoft.com/en-us/library/system.uint32(v=vs.110).aspx) |\n`uint64` | [bigint](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#bigint) | [System.UInt64](https://msdn.microsoft.com/en-us/library/system.uint64(v=vs.110).aspx) |\n`uuid` | [guid](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#guid) | [System.Guid](https://msdn.microsoft.com/en-us/library/system.guid(v=vs.110).aspx) |\n\nIf you do not define a data type, it set to\n\n* `int32`, if the column is a primary key, or...\n* `string`, if nothing else matches\n\n## Support and contribute [[\u0026uarr;](#table-of-contents)]\n\nIf you like the module, you can support the project by sending a [donation via PayPal](https://paypal.me/MarcelKloubert) to [me](https://github.com/mkloubert).\n\nTo contribute, you can [open an issue](https://github.com/mkloubert/node-entity-baker/issues) and/or fork this repository.\n\nTo work with the code:\n\n* clone [this repository](https://github.com/mkloubert/node-entity-baker)\n* create and change to a new branch, like `git checkout -b my_new_feature`\n* run `npm install` from your project folder\n* edit and debug in your favorite editor, like [Visual Studio Code](https://code.visualstudio.com)\n* commit your changes to your new branch and sync it with your forked GitHub repo\n* make a [pull request](https://github.com/mkloubert/node-entity-baker/pulls)\n\nThe API documentation can be found [here](https://mkloubert.github.io/node-entity-baker/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkloubert%2Fnode-entity-baker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkloubert%2Fnode-entity-baker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkloubert%2Fnode-entity-baker/lists"}