{"id":20407134,"url":"https://github.com/nitzano/enum-converter","last_synced_at":"2025-04-12T15:11:15.549Z","repository":{"id":32314302,"uuid":"132030212","full_name":"nitzano/enum-converter","owner":"nitzano","description":"Convert enums from one language to another","archived":false,"fork":false,"pushed_at":"2023-03-06T10:50:27.000Z","size":1982,"stargazers_count":10,"open_issues_count":21,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-06T00:18:46.982Z","etag":null,"topics":["ast","enum","enum-converter","enums","transpiler"],"latest_commit_sha":null,"homepage":"https://enum-converter.vercel.app","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/nitzano.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-03T17:45:33.000Z","updated_at":"2024-03-07T18:57:00.000Z","dependencies_parsed_at":"2024-11-15T05:33:18.529Z","dependency_job_id":null,"html_url":"https://github.com/nitzano/enum-converter","commit_stats":{"total_commits":338,"total_committers":4,"mean_commits":84.5,"dds":0.3727810650887574,"last_synced_commit":"d4f0bc7e9a03418a05a7a9aa045114a0f12d8aae"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitzano%2Fenum-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitzano%2Fenum-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitzano%2Fenum-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitzano%2Fenum-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitzano","download_url":"https://codeload.github.com/nitzano/enum-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586231,"owners_count":21128997,"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":["ast","enum","enum-converter","enums","transpiler"],"created_at":"2024-11-15T05:21:30.623Z","updated_at":"2025-04-12T15:11:15.525Z","avatar_url":"https://github.com/nitzano.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003eEnum Converter (enumc)\u003c/h1\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n\nConvert Enums from one language to another.   \n\nLive demo :  https://enum-converter.vercel.app\n ([source](https://github.com/nitzano/enum-converter-demo))\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![npm](https://img.shields.io/npm/v/enum-converter)](https://www.npmjs.com/package/enum-converter)\n[![npm-next](https://img.shields.io/npm/v/enum-converter/next)](https://www.npmjs.com/package/enum-converter)\n[![npm-downloads-week](https://img.shields.io/npm/dw/enum-converter.svg)](https://www.npmjs.com/package/enum-converter)\n![test workflow](https://github.com/nitzano/enum-converter/actions/workflows/test.yml/badge.svg)\n![release workflow](https://github.com/nitzano/enum-converter/actions/workflows/release.yml/badge.svg)\n\n[![license](https://img.shields.io/github/license/nitzano/enum-converter.svg)](https://github.com/nitzano/enum-converter/blob/master/LICENSE)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\n\u003c/div\u003e\n\n\n\n---\n\n- [Supported languages](#supported-languages)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [CLI](#cli)\n  - [API](#api)\n- [Options](#options)\n  - [Conversion](#conversion)\n  - [Styling](#styling)\n\n\n## Supported languages\n\n* [x] Java\n* [x] Json\n* [x] Python\n* [x] Typescript\n* [ ] C/C++\n* [ ] C#\n* [ ] Go\n\n\n## Installation\n\n```\nnpm install -g enum-converter\n```\n\n## Usage\n\n### CLI\n\n\u003e ``` enumc \u003cfile\u003e [options] ```\n\n```\n// convert files\nenumc enums.py --to typescript\nenumc enums.ts --to python --out my-enums.py\nenumc enums.x --from python --to json\nenumc enums.py --to typescript --sort-enums asc\n\n// modify existing files\nenumc enums.py --modify --name-style kebab --key-style upper \nenumc enums.py --modify --sort-enums=asc --sort-values=value_desc\n```\n\n### API\n\n```typescript\nimport {\n  convert,\n  EnumsOrder,\n  Language,\n  modify,\n  StringStyle,\n  ValuesOrder,\n} from 'enum-converter';\n\n// convert files\nconvert('enums.py', Language.Typescript);\n\nconvert('enums.ts', Language.Python, {\n  out: 'my-enums.py'\n});\n\nconvert('enums.x', Language.Json, {\n  from: Language.Python\n});\n\nconvert('enums.py', Language.Typescript, {\n  sortEnums: EnumsOrder.Ascending\n});\n\n// modify exiting files\nmodify('enums.py' {\n  nameStyle: StringStyle.KebabCase,\n  keyStyle: StringStyle.UpperCase,\n})\n\nmodify('enums.py' {\n  sortEnums: EnumsOrder.Ascending,\n  sortValues: ValuesOrder.ValueDescending,\n})\n```\n\n\n## Options\n\n### Conversion\n\n| Name   | Meaning                    | type     | default |\n| ------ | -------------------------- | -------- | ------- |\n| from   | source language (explicit) | Language |         |\n| to     | destination language       | Language |         |\n| out    | destination file           | string   |         |\n| modify | modify existing file       | boolean  | false   |\n\n\n### Styling\n\n| Name           | Meaning                                   | type        | default |\n| -------------- | ----------------------------------------- | ----------- | ------- |\n| emit-file-name | emit source file name to destination file | boolean     | true    |\n| emit-stats     | emit stats to destination file            | boolean     | true    |\n| sort-enums     | sort enums in files                       | EnumsOrder  |         |\n| sort-values    | sort values in enums                      | ValuesOrder |         |\n| key-style      | style enum key string                     | StringStyle |         |\n| name-style     | style enum name string                    | StringStyle |         |\n| value-style    | style enum value (strings only)           | StringStyle |         |\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitzano%2Fenum-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitzano%2Fenum-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitzano%2Fenum-converter/lists"}