{"id":30865531,"url":"https://github.com/shijistar/enum-plus","last_synced_at":"2026-05-31T12:00:30.908Z","repository":{"id":61035498,"uuid":"546112882","full_name":"shijistar/enum-plus","owner":"shijistar","description":"A drop-in replacement for native enum. Like native enum, but much better! ","archived":false,"fork":false,"pushed_at":"2026-05-28T12:56:27.000Z","size":38205,"stargazers_count":186,"open_issues_count":6,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-28T14:22:16.445Z","etag":null,"topics":["back-end","enum","enumeration","front-end","internationalization","reactjs","vuejs"],"latest_commit_sha":null,"homepage":"https://shijistar.github.io/enum-plus","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/shijistar.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-05T14:46:35.000Z","updated_at":"2026-05-03T02:23:05.000Z","dependencies_parsed_at":"2025-05-07T12:29:29.953Z","dependency_job_id":"5b68326a-a180-4e11-91af-2812b795eac4","html_url":"https://github.com/shijistar/enum-plus","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"3716c5953cc5b0952111b725bf1e0ad68ad5feb5"},"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"purl":"pkg:github/shijistar/enum-plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shijistar%2Fenum-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shijistar%2Fenum-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shijistar%2Fenum-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shijistar%2Fenum-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shijistar","download_url":"https://codeload.github.com/shijistar/enum-plus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shijistar%2Fenum-plus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33730241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"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":["back-end","enum","enumeration","front-end","internationalization","reactjs","vuejs"],"created_at":"2025-09-07T21:21:52.014Z","updated_at":"2026-05-31T12:00:30.899Z","avatar_url":"https://github.com/shijistar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD001 MD009 MD033 MD041 --\u003e\n\n[English](./README.md) | [中文](./README.zh-CN.md) | [CHANGELOG](./CHANGELOG.md)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/shijistar/enum-plus\" target=\"blank\"\u003e\n    \u003cimg src=\"./public/enum-plus.svg\" width=\"240\" alt=\"enum-plus\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eLike native enum, but much better!\u003c/strong\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eA solution for business dictionary management.\u003c/strong\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n[![npm latest version](https://img.shields.io/npm/v/enum-plus.svg?cacheSeconds=86400)](https://www.npmjs.com/package/enum-plus)\n[![npm package minimized gzipped size](https://img.shields.io/bundlejs/size/enum-plus?logo=javascript\u0026label=Minzipped\u0026color=44cc11\u0026cacheSeconds=86400)](https://www.npmjs.com/package/enum-plus?activeTab=code)\n[![npm downloads](https://img.shields.io/npm/dm/enum-plus.svg?logo=rolldown\u0026logoColor=fd7b24\u0026label=Downloads\u0026color=007ec6\u0026cacheSeconds=86400)](https://www.npmjs.com/package/enum-plus)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/shijistar/enum-plus)\n[![code coverage](https://codecov.io/gh/shijistar/enum-plus/graph/badge.svg?token=JMCDJKLT0B)](https://app.codecov.io/gh/shijistar/enum-plus)\n![GitHub License](https://img.shields.io/github/license/shijistar/enum-plus?label=License\u0026color=ff8000\u0026cacheSeconds=86400)\n\n**Supported Platforms**\n\n[![Web Browsers](https://img.shields.io/badge/Web%20Browser-2185D0?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAABa1BMVEUAAAD/1kZap04co1BLr1H/1kZKr0//zDbmXC6IzZv95Y390jpLr09Lr0//1kT/1kU8rE/aeibNi13NfUz3kUrDjVrZaTjZWib2YSn2YSj3iC33xRp7q1/91kX9211cuWxBsWv81VL/10f1jhX411Uqpk771Ub2byLNazVTq0xAq09Lr0/91EBAqk6SwFkipFD8zi/GZiz1dSHGYCb2dSDKykirw0oup0/6yiO2dzn2fhuzdDVKrlD1fxv1gBtHrU+hcCr4wRT3Vi1Lr1D/1kVHr1D+1T//10b3Uyr3TyUel+wWj+f2hhn6yiT3SR74wxOn2PmdzfINh+FErVA8rFAxqFD90Tf8zjD2Ow3j8/7g7/sinO8Zk+kRi+QIgt73RBin1fYto/EMgt3J58z88MLYvJxBrVA5qlAqplAkpFD0WC33QBOu3Pvf7vre7vqgzfG748v97rtRqk1knUSBiDembSftUiTFWBrhRxFiNA5aAAAAQnRSTlMAUQX89dtVBfv6+fHapqSJUQ39/f38/Pz7+/j48/Py8fHx7+7s6+fj4t7d3NjX1dXRz8/OzsHApqWTk46MiomAfUvELz/2AAABGUlEQVQoz52P11rCQBBGQ4mhKIK999577ytKEo2JgiaxgAIWsPfHd3Z2JXDLuTzn+ydZoWwiy0O+XK55cCVS6ld9sR1G03qRdk/LcgwKY8YJs5qGgTP377fMpCYXlw1+aPg3T0tDTV3LAdIrYaggn2Ze+85aum69tR5RtjFUEfJjJrOP1+eKksocUpYwVBLyYTZa4C9U1e4+A6YweAkhX7U69ZfHRuAUCBbCe72O/soI7AFBfgposxXqb547aBjjH6ekUyr4l8wuJcR/F4h607ZhPL32YXCxB46Cj57cdvr9XRPoRUlgEwzxu8SDZ4APOGt0EE/cexbQVwsFNtmgv30fAO8QHqGDedAi3nFwhxcnx3vEkEsSyuUPnANWVoDZ/WEAAAAASUVORK5CYII=)](https://www.npmjs.com/package/enum-plus)\n\u0026nbsp;\n[![Node compatibility](https://img.shields.io/node/v/enum-plus?logo=nodedotjs\u0026label=Node.js\u0026color=2185D0\u0026cacheSeconds=86400)](https://github.com/shijistar/enum-plus)\n\u0026nbsp;\n[![React Native](https://img.shields.io/badge/ReactNative-2185D0?logo=react)](https://reactnative.dev)\n\u0026nbsp;\n[![MiniProgram](https://img.shields.io/badge/MiniProgram-2185D0?logo=wechat)](https://developers.weixin.qq.com/miniprogram/en/dev/framework)\n\u0026nbsp;\n[![Taro](https://img.shields.io/badge/Taro-18BCF2?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAAcCAMAAADLCWbaAAABSlBMVEUAAAAAL7MAJ7QAKrcAJ7NxyP90zP8Pev8Tfv8Tff8Uff8R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docs/introduce--docs) • [Get Started](https://shijistar.github.io/enum-plus/?path=/docs/get-started--docs) • [API Reference](https://shijistar.github.io/enum-plus/?path=/docs/api--docs) • [Global Configuration](https://shijistar.github.io/enum-plus/?path=/docs/global-configuration--docs) • [User Stories](https://shijistar.github.io/enum-plus/?path=/docs/user-stories--docs) • [Plugin System](https://shijistar.github.io/enum-plus/?path=/docs/plugin-system--docs) • [Localization](https://shijistar.github.io/enum-plus/?path=/docs/localization--docs) • [Extensibility](https://shijistar.github.io/enum-plus/?path=/docs/extensibility--docs) • [Best Practices](https://shijistar.github.io/enum-plus/?path=/docs/best-practices--docs) • [Compatibility](https://shijistar.github.io/enum-plus/?path=/docs/compatibility--docs) • [FAQ](https://shijistar.github.io/enum-plus/?path=/docs/faq--docs)\n\n## Why enum-plus\n\nNative enums are great for constants, but product code usually needs more at runtime:\n\n- human-readable label,\n- metadata such as color, icon, or permission\n- dropdowns, checkboxes, and menus,\n- table filters,\n- render a label in a table,\n- render a badge color,\n- localization,\n- metadata lookups,\n- validation and lookup helpers.\n\n`enum-plus` keeps the direct enum-style experience, then adds those runtime capabilities in one place.\n\nIt's a front-end business dictionary solution, that provides a lightweight data source. It's part of the front-end infrastructure.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cdn.jsdelivr.net/gh/shijistar/enum-plus@v3.1.8/public/usage-screenshot-high-v3.mp4\" target=\"_blank\"\u003e\n    \u003cimg src=\"./public/usage-screenshot-v3.gif\" width=\"500\" alt=\"usage video\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- Compatible with the usage of native enums\n- Supports multiple data types such as `number` and `string`\n- Enhanced enum items with display names\n- Internationalization support for display names, can be integrated with any i18n library\n- Converts values directly into display names, simplifying data display in the UI\n- Extensible design, allowing custom metadata fields for enum items\n- Plugin system design, extending enum functionality through plugin installations\n- Supports type narrowing to enhance type safety\u003csup\u003e_\u0026nbsp;\u0026nbsp;TypeScript_\u003c/sup\u003e\n- Generates dropdowns from enums, compatible with UI libraries like [Ant Design](https://ant.design/components/overview), [Element Plus](https://element-plus.org/en-US/component/overview), [Material-UI](https://mui.com/material-ui)\n- Compatible with various environments including Browsers, Node.js, React Native, Taro, and mini-programs\n- Supports server-side rendering (SSR)\n- Compatible with any front-end development framework, including vanilla projects\n- TypeScript‑oriented, providing excellent type inference and code completion capabilities\n- Zero dependencies\n- Lightweight (min+gzip 2KB+ only)\n\n## Installation\n\n```bash\nnpm install enum-plus\n```\n\n## Quick example\n\n```ts\nimport { Enum } from 'enum-plus';\n\nconst StatusEnum = Enum({\n  Draft: { value: 1, label: 'Draft', color: 'default' },\n  Review: { value: 2, label: 'In Review', color: 'processing' },\n  Published: { value: 3, label: 'Published', color: 'success' },\n});\n\nStatusEnum.Review; // 2\nStatusEnum.label(2); // 'In Review'\nStatusEnum.key(2); // 'Review'\nStatusEnum.items; // [{ key: 'Draft', value: 1, label: 'Draft' }, ...]\nStatusEnum.values; // [1, 2, 3]\nStatusEnum.labels; // ['Draft', 'In Review', 'Published']\nStatusEnum.meta; // { color: [ 'default', 'processing', 'success' ] }\nStatusEnum.findBy('color', 'success')?.key; // 'Published'\nStatusEnum.toList({ valueField: 'value', labelField: 'label' }); // [{ value: 1, label: 'Draft' }, ...]\n```\n\n## Ecosystem\n\n- [@enum-plus/plugin-react](./packages/plugin-react/README.zh-CN.md)\n- [@enum-plus/plugin-react-i18next](./packages/plugin-react-i18next/README.zh-CN.md)\n- [@enum-plus/plugin-i18next](./packages/plugin-i18next/README.zh-CN.md)\n- [@enum-plus/plugin-i18next-vue](./packages/plugin-i18next-vue/README.zh-CN.md)\n- [@enum-plus/plugin-vue-i18n](./packages/plugin-vue-i18n/README.zh-CN.md)\n- [@enum-plus/plugin-next-international](./packages/plugin-next-international/README.zh-CN.md)\n- [@enum-plus/plugin-antd](./packages/plugin-antd/README.zh-CN.md)\n\n## Support\n\nIf this project helps you, please consider giving it a [star ⭐️](https://github.com/shijistar/enum-plus) on GitHub. This will encourage us to continue developing and maintaining this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshijistar%2Fenum-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshijistar%2Fenum-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshijistar%2Fenum-plus/lists"}