{"id":26611248,"url":"https://github.com/hexarc-software/csharp-dom","last_synced_at":"2025-03-24T02:35:25.698Z","repository":{"id":57115815,"uuid":"296921395","full_name":"hexarc-software/csharp-dom","owner":"hexarc-software","description":"Microsoft C# source code generation based on the language document object model","archived":false,"fork":false,"pushed_at":"2020-10-28T16:53:02.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T19:38:29.530Z","etag":null,"topics":["code","csharp","generation","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/hexarc-software/csharp-dom","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hexarc-software.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-19T17:45:17.000Z","updated_at":"2020-10-28T16:53:04.000Z","dependencies_parsed_at":"2022-08-22T16:31:08.414Z","dependency_job_id":null,"html_url":"https://github.com/hexarc-software/csharp-dom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexarc-software%2Fcsharp-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexarc-software%2Fcsharp-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexarc-software%2Fcsharp-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexarc-software%2Fcsharp-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexarc-software","download_url":"https://codeload.github.com/hexarc-software/csharp-dom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111924,"owners_count":20562511,"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","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":["code","csharp","generation","nodejs","typescript"],"created_at":"2025-03-24T02:35:25.119Z","updated_at":"2025-03-24T02:35:25.688Z","avatar_url":"https://github.com/hexarc-software.png","language":"TypeScript","readme":"Microsoft C# source code generation based on the language document object model\n======================================================\n\n[![Version](http://img.shields.io/npm/v/@hexarc/csharp-dom.svg)](https://www.npmjs.org/package/@hexarc/csharp-dom)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://badges.mit-license.org)\n[![Downloads](http://img.shields.io/npm/dm/@hexarc/csharp-dom.svg)](https://npmjs.org/package/@hexarc/csharp-dom)\n[![Downloads](http://img.shields.io/npm/dt/@hexarc/csharp-dom.svg)](https://npmjs.org/package/@hexarc/csharp-dom)\n\nGenerate Microsoft C# source files from any Node.js projects just using a simple and well-structured language document object model API.\n\nThis package is designed for usage with TypeScript and provides extensive typings for the C# document object model.\n\n# Setup\nInstall with npm:\n\n```sh\nnpm install @hexarc/csharp-dom\n```\n\nUsing with node.js (ES6 syntax):\n\n```js\nimport * as CSharpDom from \"@hexarc/csharp-dom\";\n```\n\nOr using the CommonJS module syntax:\n\n```js\nconst CSharpDom = require(\"@hexarc/csharp-dom\");\n```\n\n# Examples\n* [Generate a POCO class](#generate-a-poco-class)\n* [Generate an enum](#generate-an-enum)\n\n## Generate a POCO class ##\n```ts\nimport * as fs from \"fs\";\nimport * as CSharpDom from \"@hexarc/csharp-dom\";\n\n\nconst codeUnit: Hexarc.CSharpDom.CodeUnit = {\n  name: \"Point2D.cs\",\n  namespaces: [{\n    path: [\"Hexarc\", \"Geometry\"],\n    types: [{\n      kind: \"class\",\n      access: \"public\",\n      modifier: \"sealed\",\n      name: \"Point2D\",\n      members: [{\n        kind: \"property\",\n        access: \"public\",\n        type: { namespace: \"System\", name: \"Single\" },\n        name: \"X\"\n      }, {\n        kind: \"property\",\n        access: \"public\",\n        type: { namespace: \"System\", name: \"Single\" },\n        name: \"Y\"\n      }]\n    }]\n  }]\n};\n\nfs.writeFileSync(codeUnit.name, CSharpDom.emit(codeUnit));\n```\n\n```cs\nnamespace Hexarc.Geometry\n{\n    public sealed class Point2D\n    {\n        public System.Single X { get; set; }\n        \n        public System.Single Y { get; set; }\n    }\n}\n```\n\n## Generate an enum ##\n```ts\nimport * as fs from \"fs\";\nimport * as CSharpDom from \"@hexarc/csharp-dom\";\n\n\nconst codeUnit: Hexarc.CSharpDom.CodeUnit = {\n  name: \"enum.cs\",\n  namespaces: [{\n    path: [\"Hexarc\", \"Flags\"],\n    types: [{\n      kind: \"enum\",\n      access: \"public\",\n      name: \"Direction\",\n      members: [{\n        name: \"Up\"\n      }, {\n        name: \"Down\"\n      }, {\n        name: \"Left\"\n      }, {\n        name: \"Right\"\n      }]\n    }]\n  }]\n};\n\nfs.writeFileSync(codeUnit.name, CSharpDom.emit(codeUnit));\n```\n\n```csharp\nnamespace Hexarc.Flags\n{\n    public enum Direction\n    {\n        Up,\n        Down,\n        Left,\n        Right\n    }\n}\n```\n\n## License\n\n[MIT](LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexarc-software%2Fcsharp-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexarc-software%2Fcsharp-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexarc-software%2Fcsharp-dom/lists"}