{"id":13525550,"url":"https://github.com/sindresorhus/decamelize","last_synced_at":"2025-05-15T10:00:22.884Z","repository":{"id":26325321,"uuid":"29773710","full_name":"sindresorhus/decamelize","owner":"sindresorhus","description":"Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow","archived":false,"fork":false,"pushed_at":"2022-10-30T10:53:22.000Z","size":40,"stargazers_count":239,"open_issues_count":2,"forks_count":26,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-29T00:06:56.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-01-24T10:57:45.000Z","updated_at":"2025-04-01T16:57:46.000Z","dependencies_parsed_at":"2022-09-10T23:41:50.488Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/decamelize","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdecamelize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdecamelize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdecamelize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdecamelize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/decamelize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252638821,"owners_count":21780632,"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-01T06:01:19.848Z","updated_at":"2025-05-15T10:00:21.690Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","readme":"# decamelize\n\n\u003e Convert a camelized string into a lowercased one with a custom separator\\\n\u003e Example: `unicornRainbow` → `unicorn_rainbow`\n\nIf you use this on untrusted user input, don't forget to limit the length to something reasonable.\n\n## Install\n\n```sh\nnpm install decamelize\n```\n\n*If you need Safari support, [stay on](https://github.com/sindresorhus/decamelize/issues/24) [version 3](https://github.com/sindresorhus/decamelize/issues/36) [until they implement](https://caniuse.com/js-regexp-lookbehind) regex lookbehinds.*\n\n## Usage\n\n```js\nimport decamelize from 'decamelize';\n\ndecamelize('unicornRainbow');\n//=\u003e 'unicorn_rainbow'\n\ndecamelize('unicornRainbow', {separator: '-'});\n//=\u003e 'unicorn-rainbow'\n\ndecamelize('testGUILabel', {preserveConsecutiveUppercase: true});\n//=\u003e 'test_GUI_label'\n\ndecamelize('testGUILabel', {preserveConsecutiveUppercase: false});\n//=\u003e 'test_gui_label'\n```\n\n## API\n\n### decamelize(input, options?)\n\n#### input\n\nType: `string`\n\n#### options\n\nType: `object`\n\n##### separator\n\nType: `string`\\\nDefault: `'_'`\n\nThe character or string used to separate words.\n\n```js\nimport decamelize from 'decamelize';\n\ndecamelize('unicornRainbow');\n//=\u003e 'unicorn_rainbow'\n\ndecamelize('unicornRainbow', {separator: '-'});\n//=\u003e 'unicorn-rainbow'\n```\n\n##### preserveConsecutiveUppercase\n\nType: `boolean`\\\nDefault: `false`\n\nPreserve sequences of uppercase characters.\n\n```js\nimport decamelize from 'decamelize';\n\ndecamelize('testGUILabel');\n//=\u003e 'test_gui_label'\n\ndecamelize('testGUILabel', {preserveConsecutiveUppercase: true});\n//=\u003e 'test_GUI_label'\n```\n\n## Related\n\n- [camelcase](https://github.com/sindresorhus/camelcase) - The inverse of this package\n- [decamelize-keys](https://github.com/sindresorhus/decamelize-keys) - Convert object keys from camel case\n","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["Repository","JavaScript","Modules","模块"],"sub_categories":["Text/String","String"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fdecamelize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fdecamelize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fdecamelize/lists"}