{"id":21311959,"url":"https://github.com/vhidvz/naming-conventions-modeler","last_synced_at":"2025-07-11T23:33:02.237Z","repository":{"id":63425848,"uuid":"544782002","full_name":"vhidvz/naming-conventions-modeler","owner":"vhidvz","description":"Simple and Fast naming conventions modeler implemented by Proxy, zero dependencies.","archived":false,"fork":false,"pushed_at":"2024-12-09T16:34:38.000Z","size":658,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T05:20:18.478Z","etag":null,"topics":["modeler","naming-conventions","proxy","zero-dependency"],"latest_commit_sha":null,"homepage":"https://vhidvz.github.io/naming-conventions-modeler/","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/vhidvz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2022-10-03T08:05:06.000Z","updated_at":"2024-12-20T09:19:23.000Z","dependencies_parsed_at":"2024-01-21T06:25:25.949Z","dependency_job_id":"153714d7-3347-4c7b-81aa-1c67a1b2ac8c","html_url":"https://github.com/vhidvz/naming-conventions-modeler","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.09090909090909094,"last_synced_commit":"71c734e61422107473e270ecfcc1c285b544c9b9"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/vhidvz/naming-conventions-modeler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhidvz%2Fnaming-conventions-modeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhidvz%2Fnaming-conventions-modeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhidvz%2Fnaming-conventions-modeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhidvz%2Fnaming-conventions-modeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vhidvz","download_url":"https://codeload.github.com/vhidvz/naming-conventions-modeler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhidvz%2Fnaming-conventions-modeler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264914166,"owners_count":23682792,"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":["modeler","naming-conventions","proxy","zero-dependency"],"created_at":"2024-11-21T17:22:42.778Z","updated_at":"2025-07-11T23:33:01.934Z","avatar_url":"https://github.com/vhidvz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Naming Conventions Modeler\n\n[![npm](https://img.shields.io/npm/v/naming-conventions-modeler)](https://www.npmjs.com/package/naming-conventions-modeler)\n[![Coverage](https://raw.githubusercontent.com/vhidvz/naming-conventions-modeler/master/coverage-badge.svg)](https://htmlpreview.github.io/?https://github.com/vhidvz/naming-conventions-modeler/blob/master/docs/coverage/lcov-report/index.html)\n![npm](https://img.shields.io/npm/dm/naming-conventions-modeler)\n[![GitHub](https://img.shields.io/github/license/vhidvz/naming-conventions-modeler?style=flat)](https://vhidvz.github.io/naming-conventions-modeler/)\n[![Gitter](https://badges.gitter.im/naming-conventions-modeler-npm/community.svg)](https://gitter.im/naming-conventions-modeler-npm/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![documentation](https://img.shields.io/badge/documentation-click_to_read-c27cf4)](https://vhidvz.github.io/naming-conventions-modeler/)\n[![Build, Test and Publish](https://github.com/vhidvz/naming-conventions-modeler/actions/workflows/npm-ci.yml/badge.svg)](https://github.com/vhidvz/naming-conventions-modeler/actions/workflows/npm-ci.yml)\n\nSimple and Fast `TypeSafe` naming conventions modeler implemented with `Proxy`; zero dependency.\n\n## Quick Start Guide\n\n```sh\nnpm install --save naming-conventions-modeler\n```\n\n| **Original**              | **snake_case**          | **camelCase**         | **PascalCase**        | **kebab-case**          | **MACRO_CASE**          | **Train-Case**          | **flatcase**          | **no case**             |\n| ------------------------- | ----------------------- | --------------------- | --------------------- | ----------------------- | ----------------------- | ----------------------- | --------------------- | ----------------------- |\n| **RegExr**                | reg_exr                 | regExr                | RegExr                | reg-exr                 | REG_EXR                 | Reg-Exr                 | regexr                | Reg Exr                 |\n| **PCRE**                  | pcre                    | pcre                  | PCRE                  | pcre                    | PCRE                    | PCRE                    | pcre                  | PCRE                    |\n| **JavaScript**            | java_script             | javaScript            | JavaScript            | java-script             | JAVA_SCRIPT             | Java-Script             | javascript            | Java Script             |\n| **JSProgrammingLanguage** | js_programming_language | jsProgrammingLanguage | JSProgrammingLanguage | js-programming-language | JS_PROGRAMMING_LANGUAGE | JS-Programming-Language | jsprogramminglanguage | JS Programming Language |\n| **OTP**                   | otp                     | otp                   | OTP                   | otp                     | OTP                     | OTP                     | otp                   | OTP                     |\n| **Train-Case**            | train_case              | trainCase             | TrainCase             | train-case              | TRAIN_CASE              | Train-Case              | traincase             | Train Case              |\n| **\\_\\_meta\\_\\_**          | meta                    | meta                  | Meta                  | meta                    | META                    | Meta                    | meta                  | meta                    |\n| **camelCase**             | camel_case              | camelCase             | CamelCase             | camel-case              | CAMEL_CASE              | Camel-Case              | camelcase             | camel Case              |\n| **\\_id**                  | id                      | id                    | Id                    | id                      | ID                      | Id                      | id                    | id                      |\n| **ID**                    | id                      | id                    | ID                    | id                      | ID                      | ID                      | id                    | ID                      |\n| **iD**                    | id                      | id                    | ID                    | id                      | ID                      | ID                      | id                    | iD                      |\n| **id**                    | id                      | id                    | Id                    | id                      | ID                      | Id                      | id                    | id                      |\n| **Id**                    | id                      | id                    | Id                    | id                      | ID                      | Id                      | id                    | Id                      |\n| **0123**                  | 0123                    | 0123                  | 0123                  | 0123                    | 0123                    | 0123                    | 0123                  | 0123                    |\n| **\\_-$#@**                | $#@                     | $#@                   | $#@                   | $#@                     | $#@                     | $#@                     | $#@                   | $#@                     |\n\n### Modeler\n\n```ts\nimport { Modeler, lookup } from 'naming-conventions-modeler';\n\nlet obj = {\n  _id: 123,\n  TestValue: 'test value',\n  data: {\n    _id: 456,\n    test_value: '456',\n  },\n  items: [\n    {\n      _id: 789,\n      test_value: '789',\n    },\n  ],\n  __meata__: 'metadata',\n};\n\ntype camelObj = {\n  // type safety support\n  id: number;\n  testValue: string;\n  data: {\n    id: number;\n    testValue: string;\n    [x: string]: any;\n  };\n  items: [\n    {\n      id: number;\n      testValue: string;\n    },\n  ];\n  meta: string;\n  [x: string]: any;\n};\n\n// Replace misspell keys by regex\nobj = lookup(obj, { '__me.*ta__': '__meta__' });\n\nconst model = Modeler.build\u003ccamelObj\u003e(obj, 'camelCase');\n\nconsole.log(model.id); // 123\n\nconsole.log(model.testValue); // test value\nconsole.log(model.TestValue); // test value\n\nconsole.log(model.data.id); // 456\nconsole.log(model.items[0].testValue); // 789\n\n// Set value dynamically\nmodel.NO_name = 'no name';\nmodel.NO_VALUE = 'no value';\n\nconsole.log(model.noName); // no name\nconsole.log(model.noValue); // no value\n\n/**\n * It takes an convention model and converts all properties at once\n */\nModeler.convert(model);\n\nconsole.log(model);\n/**\n * {\n *   data: { id: 456, testValue: '456' },\n *   items: [ { testValue: '789', id: 789 } ],\n *   testValue: 'test value',\n *   noName: 'no name',\n *   noValue: 'no value',\n *   id: 123,\n *   meta: 'metadata'\n * }\n */\n```\n\n### Tools\n\n```ts\nimport { convention, toSnakeCase, isSnakeCase } from 'naming-conventions-modeler';\n\nconst str = 'JSProgrammingLanguage';\n\nconst camelCase = convention('camelCase');\n\nconsole.log(camelCase.to(str)); // jsProgrammingLanguage\n\nconsole.log(toSnakeCase(str)); // js_programming_language\n\nconsole.log(isSnakeCase(toSnakeCase(str))); // true\n```\n\n## License\n\n[MIT](https://github.com/vhidvz/naming-conventions-modeler/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvhidvz%2Fnaming-conventions-modeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvhidvz%2Fnaming-conventions-modeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvhidvz%2Fnaming-conventions-modeler/lists"}