{"id":24926916,"url":"https://github.com/divedylan/enum-maker","last_synced_at":"2025-03-28T12:26:36.074Z","repository":{"id":57225806,"uuid":"381215674","full_name":"diveDylan/enum-maker","owner":"diveDylan","description":"make enums from Map, Array","archived":false,"fork":false,"pushed_at":"2021-11-30T05:15:23.000Z","size":291,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T00:17:53.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/diveDylan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-29T02:26:22.000Z","updated_at":"2023-03-07T07:14:06.000Z","dependencies_parsed_at":"2022-08-24T11:00:34.394Z","dependency_job_id":null,"html_url":"https://github.com/diveDylan/enum-maker","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/diveDylan%2Fenum-maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diveDylan%2Fenum-maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diveDylan%2Fenum-maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diveDylan%2Fenum-maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diveDylan","download_url":"https://codeload.github.com/diveDylan/enum-maker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246028571,"owners_count":20712047,"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":[],"created_at":"2025-02-02T12:53:56.848Z","updated_at":"2025-03-28T12:26:36.048Z","avatar_url":"https://github.com/diveDylan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 style=\"text-align: center\"\u003e enum-maker \u003c/h1\u003e\n\n\u003cp style=\"text-align: center\"\u003e\n\u003cimg src=\"https://img.shields.io/travis/com/pregalaxyer/enum-maker\"/\u003e\n\u003cimg src=\"https://img.shields.io/codecov/c/github/pregalaxyer/enum-maker\"/\u003e\n\u003cimg src=\"https://img.shields.io/npm/pregalaxyer/enum-maker\"\u003e\n\u003cp\u003e\n\u003cbr/\u003e\n\n\u003cp style=\"text-align: center\"\u003e\n  单纯使用枚举和字典的场景不应该绑定太多依赖, 所以从 \u003ca href=\"https://github.com/diveDylan/sandfish\"\u003e\u003ccode\u003esandfish\u003c/code\u003e\u003c/a\u003e 中抽出 \u003ccode\u003eenum-maker\u003c/code\u003e\n\u003c/p\u003e\n\n\n### Install\n\n```bash\nnpm install enum-maker\n## or\nyarn add enum-maker\n## or \npnpm install enum-maker\n\n```\n\n### Usage\n\n我们认为用数字命名枚举是不合法且毫无可读性可言的行为，会使系统陷入迭代维护困境。插件会自动为你过滤用数字命名的枚举\n\n\n```js\nconst { generateEnums } = require('enum-maker');\n\ngenerateEnums({\n  // 字典数据\n  enums: yourEnumsData,\n  outputPath: output,\n  // 格式化字典格式\n  formatterFn: (enumsItem) =\u003e {\n    // do something\n    return {\n      label: someLabel,\n      value: someValue,\n    };\n  },\n  // 权限\n  permissionKey: 'permissionKey'\n});\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivedylan%2Fenum-maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivedylan%2Fenum-maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivedylan%2Fenum-maker/lists"}