Convert dash/dot/underscore/space separated strings to camelCase or PascalCase with Unicode support.
camelcase is a JavaScript library that converts strings separated by dashes, dots, underscores, or spaces into camelCase or PascalCase format. It solves the problem of normalizing inconsistent string formats into a standardized camelCase convention commonly used in JavaScript programming. The library handles Unicode characters and offers configurable options for different transformation needs.
JavaScript and Node.js developers who need to normalize string identifiers, property names, or variables from various separators into camelCase format.
Developers choose camelcase for its reliability, Unicode support, and flexible configuration options like locale-aware conversion and control over number handling, making it more robust than basic string replacement solutions.
Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Correctly processes international characters, as demonstrated with examples like 'розовый_пушистый_единорог' converting accurately to camelCase.
Offers PascalCase conversion, preserveConsecutiveUppercase, and locale-aware settings, allowing precise control over output format.
Supports locale-specific case mappings, enabling correct transformations for languages like Turkish where 'i' maps to 'İ', as shown in the README examples.
Provides capitalizeAfterNumber option to align with different style guides, such as Google Java Style or Lodash defaults, for letters following digits.
As admitted in the README, transformations are not idempotent when special characters are present, leading to inconsistent results like '{ A' → '{A}' but '{A}' → '{a}'.
Only converts to camelCase or PascalCase; for other formats like snake_case, developers must use separate libraries like decamelize, adding dependency overhead.
Features like locale support and Unicode processing may introduce performance costs compared to simpler, regex-based alternatives, especially in high-frequency use cases.