{"id":13671000,"url":"https://github.com/joakimbeng/kebab-case","last_synced_at":"2025-09-01T17:31:19.823Z","repository":{"id":43786877,"uuid":"48702478","full_name":"joakimbeng/kebab-case","owner":"joakimbeng","description":"Convert a string to kebab-case, i.e. its dash separated form","archived":false,"fork":false,"pushed_at":"2024-07-01T07:42:43.000Z","size":37,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-22T04:11:52.488Z","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/joakimbeng.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":"2015-12-28T16:52:32.000Z","updated_at":"2024-06-28T20:49:07.000Z","dependencies_parsed_at":"2024-06-18T14:53:30.250Z","dependency_job_id":"8b5a2404-7cbd-4909-8be1-86022d08e56d","html_url":"https://github.com/joakimbeng/kebab-case","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.5555555555555556,"last_synced_commit":"66b27a702fdc47850cf3b3e107d770e7fa8c44df"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakimbeng%2Fkebab-case","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakimbeng%2Fkebab-case/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakimbeng%2Fkebab-case/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakimbeng%2Fkebab-case/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joakimbeng","download_url":"https://codeload.github.com/joakimbeng/kebab-case/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231701542,"owners_count":18413421,"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":"2024-08-02T09:00:55.463Z","updated_at":"2024-12-29T05:07:10.084Z","avatar_url":"https://github.com/joakimbeng.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# kebab-case\n\n[![NPM version][npm-image]][npm-url]\n\n\u003e Convert a string to kebab-case, i.e. its dash separated form\n\nThe difference between `kebab-case` and e.g. [`dashify`](https://www.npmjs.com/package/dashify) is that this\nmodule doesn't modify the string in any other way than transforming uppercased letters to their lowercased\ncounterparts prefixed with `-`. Thanks to this there's also a [`reverse`](#kebabcasereversestr) function to\ndo the opposite, i.e. get back the original value.\n\nThis is used in [Unistyle](https://github.com/joakimbeng/unistyle) to transform JavaScript CSS properties\nto their CSS counterparts without losing a possible browser prefix, e.g: `WebkitTransform -\u003e -webkit-transform`.\n\n## Installation\n\nInstall `kebab-case` using [npm](https://www.npmjs.com/):\n\n```bash\nnpm install --save kebab-case\n```\n\n## Usage\n\n### Module usage\n\n```javascript\nimport kebabCase from \"kebab-case\";\n\nkebabCase(\"WebkitTransform\");\n// \"-webkit-transform\"\nkebabCase.reverse(\"-webkit-transform\");\n// \"WebkitTransform\"\nkebabCase(\"WebkitTransform\", false);\n// \"webkit-transform\"\n```\n\n## API\n\n### `kebabCase(str)`\n\n| Name            | Type      | Description                                                 |\n| --------------- | --------- | ----------------------------------------------------------- |\n| str             | `String`  | The string to convert                                       |\n| keepLeadingDash | `Boolean` | Whether to keep the leading dash or not. Default is `true`. |\n\nReturns: `String`, the kebab cased string.\n\n### `kebabCase.reverse(str)`\n\n| Name | Type     | Description                |\n| ---- | -------- | -------------------------- |\n| str  | `String` | The string to convert back |\n\nReturns: `String`, the \"unkebab cased\" string.\n\n## License\n\nMIT © [Joakim Carlstein](https://joakim.beng.se/)\n\n[npm-url]: https://npmjs.org/package/kebab-case\n[npm-image]: https://badge.fury.io/js/kebab-case.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoakimbeng%2Fkebab-case","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoakimbeng%2Fkebab-case","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoakimbeng%2Fkebab-case/lists"}