{"id":16515160,"url":"https://github.com/jacobwgillespie/fast-case","last_synced_at":"2025-05-09T01:44:47.320Z","repository":{"id":30610342,"uuid":"125476834","full_name":"jacobwgillespie/fast-case","owner":"jacobwgillespie","description":"⚡Fast camelCase and PascalCase string and key conversion for JavaScript (Node / browser)","archived":false,"fork":false,"pushed_at":"2024-10-05T13:05:17.000Z","size":984,"stargazers_count":19,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-09T01:44:41.918Z","etag":null,"topics":["browser","camelcase","nodejs","pascalcase"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fast-case","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/jacobwgillespie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-03-16T07:01:47.000Z","updated_at":"2025-04-01T21:01:33.000Z","dependencies_parsed_at":"2024-10-28T10:14:33.483Z","dependency_job_id":"5b469073-d24e-47d1-a4c3-06ac98f55afd","html_url":"https://github.com/jacobwgillespie/fast-case","commit_stats":{"total_commits":171,"total_committers":3,"mean_commits":57.0,"dds":"0.42105263157894735","last_synced_commit":"a77f71d6aed7db56f05b4e43bfd688c6f4c60860"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Ffast-case","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Ffast-case/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Ffast-case/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Ffast-case/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobwgillespie","download_url":"https://codeload.github.com/jacobwgillespie/fast-case/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253176444,"owners_count":21866142,"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":["browser","camelcase","nodejs","pascalcase"],"created_at":"2024-10-11T16:15:47.653Z","updated_at":"2025-05-09T01:44:47.297Z","avatar_url":"https://github.com/jacobwgillespie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ fast-case\n\n[![Build Status](https://github.com/jacobwgillespie/fast-case/workflows/CI/badge.svg)](https://github.com/jacobwgillespie/fast-case/actions)\n[![npm](https://badgen.net/npm/dm/fast-case)](https://www.npmjs.com/package/fast-case)\n[![npm](https://badgen.net/npm/v/fast-case)](https://www.npmjs.com/package/fast-case)\n\n`fast-case` is a JavaScript library for camelcase and pascalcase. It is designed to be similar to [humps][0] and [xcase][1], with algorithm optimizations for additional speed.\n\n## Installation\n\n```bash\n$ yarn add fast-case\n```\n\n## Usage\n\n```javascript\nimport {\n  camelize,\n  decamelize,\n  pascalize,\n  depascalize,\n  camelizeKeys,\n  camelizeKeysInPlace,\n  decamelizeKeys,\n  decamelizeKeysInPlace,\n  pascalizeKeys,\n  pascalizeKeysInPlace,\n  depascalizeKeys,\n  depascalizeKeysInPlace,\n} from 'fast-case'\n\n// 'a_string' -\u003e 'aString'\ncamelize(string)\n\n// 'aString' -\u003e 'a_string'\ndecamelize(string)\n\n// Optional custom separator\n// 'aString' -\u003e 'a-string'\ndecamelize(string, '-')\n\n// 'a_string' -\u003e 'AString'\npascalize(string)\n\n// 'AString' -\u003e 'a_string'\ndepascalize(string)\n\n// Optional custom separator\n// 'AString' -\u003e 'a-string'\ndepascalize(string, '-')\n\n// Camelize all object keys (recursive),\n// optionally modify the object in-place.\ncamelizeKeys(obj)\ncamelizeKeysInPlace(obj)\n\n// De-camelize all object keys (recursive),\n// optionally modify the object in-place.\ndecamelizeKeys(obj)\ndecamelizeKeysInPlace(obj)\n\n// Pascalize all object keys (recursive),\n// optionally modify the object in-place.\npascalizeKeys(obj)\npascalizeKeysInPlace(obj)\n\n// De-pascalize all object keys (recursive),\n// optionally modify the object in-place.\ndepascalizeKeys(obj)\ndepascalizeKeysInPlace(obj)\n\n// Optional custom separator for decamelizeKeys,\n// depascalizeKeys, and in-place variants.\ndecamelizeKeys(obj, '-')\ndecamelizeKeysInPlace(obj, '-')\ndepascalizeKeys(obj, '-')\ndepascalizeKeysInPlace(obj, '-')\n```\n\n## Benchmark\n\nRun `yarn benchmark` to benchmark locally. Informal benchmark results are available [via GitHub Actions](https://github.com/jacobwgillespie/fast-case/actions?query=workflow%3ABenchmark).\n\n```\nxcase#camelize x 6,600,243 ops/sec ±0.72% (191 runs sampled)\nfastCase#camelize x 7,716,825 ops/sec ±0.78% (190 runs sampled)\nhumps#camelize x 1,150,491 ops/sec ±0.54% (191 runs sampled)\nFastest is fastCase#camelize\n\nxcase#decamelize x 6,095,752 ops/sec ±0.63% (192 runs sampled)\nfastCase#decamelize x 6,251,767 ops/sec ±0.73% (192 runs sampled)\nhumps#decamelize x 2,087,936 ops/sec ±0.94% (189 runs sampled)\nFastest is fastCase#decamelize\n\nxcase#pascalize x 6,623,570 ops/sec ±0.77% (188 runs sampled)\nfastCase#pascalize x 7,438,234 ops/sec ±0.74% (188 runs sampled)\nhumps#pascalize x 1,060,071 ops/sec ±0.66% (192 runs sampled)\nFastest is fastCase#pascalize\n\nxcase#depascalize x 6,207,477 ops/sec ±0.57% (191 runs sampled)\nfastCase#depascalize x 6,130,597 ops/sec ±0.73% (186 runs sampled)\nhumps#depascalize x 1,909,126 ops/sec ±0.93% (190 runs sampled)\nFastest is xcase#depascalize\n\nxcase#camelizeKeys x 749,311 ops/sec ±0.68% (190 runs sampled)\nfastCase#camelizeKeys x 794,874 ops/sec ±0.72% (191 runs sampled)\nhumps#camelizeKeys x 224,859 ops/sec ±0.52% (191 runs sampled)\nFastest is fastCase#camelizeKeys\n\nxcase#camelizeKeys (in place) x 835,931 ops/sec ±0.75% (190 runs sampled)\nfastCase#camelizeKeysInPlace (in place) x 844,663 ops/sec ±0.88% (191 runs sampled)\nFastest is fastCase#camelizeKeysInPlace (in place)\n\nxcase#decamelizeKeys x 812,360 ops/sec ±0.86% (191 runs sampled)\nfastCase#decamelizeKeys x 786,222 ops/sec ±0.69% (189 runs sampled)\nhumps#decamelizeKeys x 378,324 ops/sec ±0.70% (192 runs sampled)\nFastest is xcase#decamelizeKeys\n\nxcase#camelizeKeys (large object) x 822 ops/sec ±0.77% (187 runs sampled)\nfastCase#camelizeKeys (large object) x 962 ops/sec ±1.16% (185 runs sampled)\nhumps#camelizeKeys (large object) x 282 ops/sec ±0.79% (185 runs sampled)\nFastest is fastCase#camelizeKeys (large object)\n\nxcase#camelizeKeys (in place) (large object) x 688 ops/sec ±1.28% (181 runs sampled)\nfastCase#camelizeKeysInPlace (in place) (large object) x 1,011 ops/sec ±0.59% (189 runs sampled)\nFastest is fastCase#camelizeKeysInPlace (in place) (large object)\n\nxcase#pascalizeKeys (large object) x 589 ops/sec ±0.60% (183 runs sampled)\nfastCase#pascalizeKeys (large object) x 680 ops/sec ±0.97% (186 runs sampled)\nhumps#pascalizeKeys (large object) x 338 ops/sec ±0.72% (181 runs sampled)\nFastest is fastCase#pascalizeKeys (large object)\n\nxcase#pascalizeKeys (in place) (large object) x 1,007 ops/sec ±0.79% (183 runs sampled)\nfastCase#pascalizeKeysInPlace (in place) (large object) x 1,356 ops/sec ±0.75% (188 runs sampled)\nFastest is fastCase#pascalizeKeysInPlace (in place) (large object)\n```\n\n## Credits\n\nThis module is based in part on an older C++ based version of `xcase`.\n\n## License\n\nMIT license, see `LICENSE`. Copyright 2018 Jacob Gillespie. Code originally from [xcase][1], copyright 2016 Code Charm.\n\n[0]: https://github.com/domchristie/humps\n[1]: https://github.com/encharm/xcase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwgillespie%2Ffast-case","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobwgillespie%2Ffast-case","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwgillespie%2Ffast-case/lists"}