camelcase
Converts strings to camelCase. Handles hyphen-separated, underscore-separated, space-separated, and mixed case strings. Supports Unicode, locale-aware capitalization, and PascalCase output. Published by Sindre Sorhus — ESM-only since v7. Lightweight zero-dependency utility used across thousands of npm packages.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Zero dependencies, local computation, MIT licensed. No security concerns — pure string transformation.
⚡ Reliability
Best When
You specifically need camelCase conversion in an ESM environment and want a focused, zero-dependency utility from a trusted maintainer.
Avoid When
You need multiple case conversions (snake_case, kebab-case, PascalCase, CONSTANT_CASE all in one project) — use change-case instead to avoid managing multiple packages.
Use Cases
- • Convert API response field names from snake_case to camelCase for JavaScript object normalization
- • Transform CLI flag names (--my-flag) to camelCase property names in argument parsers
- • Normalize variable names in agent code generation pipelines when generating JavaScript/TypeScript code
- • Convert configuration keys between different naming conventions when processing YAML/TOML configs
- • Generate camelCase identifiers from natural language strings in code scaffolding tools
Not For
- • Multi-convention string transformations — use the 'change-case' package for all-in-one case conversion (snake, kebab, pascal, constant, etc.)
- • CommonJS environments — v7+ is ESM-only; use v6 for CommonJS or switch to change-case
- • Non-English character handling edge cases — locale-aware options exist but Unicode edge cases may require testing
Interface
Authentication
Local library — no authentication required. MIT licensed.
Pricing
MIT licensed. Zero cost.
Agent Metadata
Known Gotchas
- ⚠ v7+ is ESM-only — CommonJS require() fails; use v6 (camelcase@6) for CommonJS projects or switch to 'change-case' which supports both
- ⚠ Array input joins elements: camelCase(['foo', 'bar']) returns 'fooBar' — useful for building identifiers from word arrays
- ⚠ pascalCase option converts to PascalCase (UpperCamelCase): { pascalCase: true } — no separate package needed for PascalCase
- ⚠ Preserves consecutive uppercase sequences by default — 'XMLParser' stays 'XMLParser', not 'xmlParser'; use { preserveConsecutiveUppercase: false } to normalize
- ⚠ Locale-aware option: { locale: 'tr' } uses Turkish/Azerbaijani rules for i/I capitalization — needed for correct multilingual output
- ⚠ Does NOT handle all change-case patterns — no snake_case, kebab-case, or CONSTANT_CASE output; install change-case for multi-convention projects
Alternatives
Full Evaluation Report
Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for camelcase.
AI-powered analysis · PDF + markdown · Delivered within 30 minutes
Package Brief
Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.
Delivered within 10 minutes
Score Monitoring
Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.
Continuous monitoring
Scores are editorial opinions as of 2026-03-07.