{"id":16553235,"url":"https://github.com/allejo/aclovis","last_synced_at":"2026-05-07T21:43:20.729Z","repository":{"id":57172610,"uuid":"105080371","full_name":"allejo/aclovis","owner":"allejo","description":"A Typescript library for programmatically generating C++ code","archived":false,"fork":false,"pushed_at":"2019-01-25T18:39:46.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T03:03:22.646Z","etag":null,"topics":["code-generation","cpp","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/aclovis","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/allejo.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":"2017-09-27T23:39:03.000Z","updated_at":"2019-11-04T03:19:21.000Z","dependencies_parsed_at":"2022-08-24T13:30:58.849Z","dependency_job_id":null,"html_url":"https://github.com/allejo/aclovis","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Faclovis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Faclovis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Faclovis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allejo%2Faclovis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allejo","download_url":"https://codeload.github.com/allejo/aclovis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241901300,"owners_count":20039597,"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-generation","cpp","typescript"],"created_at":"2024-10-11T19:47:31.630Z","updated_at":"2026-05-07T21:43:15.693Z","avatar_url":"https://github.com/allejo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aclovis\n\n\u003e :warning: :construction: :construction: :construction: :warning:\n\u003e\n\u003e Before exploring this project further, I am *brand new* to the world of JavaScript, Typescript, npm, and friends. This project **works** however, I don't guarantee that it follows best practices or is even packaged correctly.\n\u003e\n\u003e This project is my learning ground for the JS world. So if you're a JS expert (or you just know the pain I'm going through by entering the JS world) and you have an unsolicited advice/tips, they are welcome and I'd highly appreciate it!\n\nWelcome to aclovis! A library that allows you to programmatically generate C++ code (and maybe other languages in the future) from JavaScript or Typescript.\n\nAs mentioned in the beginning, this project is incredibly young and will likely be changing a lot. The fact that this project is starting at version 0.0.0 should be a sign of its stability. You have been warned!\n\n## Okay. But why tho?\n\nFor my [BZFlag Plug-in Starter](https://github.com/allejo/bzflagPluginStarter2), I needed a way to programmatically generate C++ to help developers get started with writing plug-ins quickly. The initial version was written in a hurry and dubbed \"CodeBuilder.\" It was time for me to properly learn JS and TS, so I decided to give the project another look and rewrite it.\n\n## Usage\n\nFor the most up to date examples and functionality, it is highly recommended that you look at the [unit tests](/tests/) for the project.\n\n```js\nimport { CPPClass, CPPFormatter, CPPFunction, CPPVariable, CPPVisibility } from 'aclovis';\n\nlet cppclass = new CPPClass('PetThief');\nlet stealFxn = new CPPFunction('void', 'steal', [\n    CPPVariable.createInt('owner'),\n    CPPVariable.createInt('target', -1)\n]);\n\nstealFxn.setVirtual(true);\nstealFxn.setParentClass(cppclass, CPPVisibility.Public);\n\nlet fmtr = new CPPFormatter({\n    indentWithSpaces: true,\n    indentSpaceCount: 4,\n    bracesOnNewLine: true\n});\n\nlet output = cppclass.writeHeaderBlock(fmtr, 0);\n```\n\nAnd here's what would be outputted when you write out the class.\n\n```cpp\nclass PetThief\n{\n    virtual void steal(int owner, int target = -1);\n};\n```\n\n## Future Plans\n\nIf I am able to pick up some better practices, I'll definitely expand this to be able to generate other languages. I attempted to write some generic interfaces that *should* be able to work across different languages but for right now, C++ is the main focus.\n\n## License\n\n[MIT](/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallejo%2Faclovis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallejo%2Faclovis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallejo%2Faclovis/lists"}