Skip to main content
This release is 5 versions behind 1.33.0 — the latest version of @es-toolkit/es-toolkit. Jump to latest

@es-toolkit/es-toolkit@1.29.0-dev.958+1d1d0ee6
Built and signed on GitHub Actions

A modern JavaScript utility library that's 2-3 times faster and up to 97% smaller—a major upgrade to lodash.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (1.29.0-dev.958+1d1d0ee6)
function camelCase
camelCase(str?: string | object): string

Converts a string to camel case.

Camel case is the naming convention in which the first word is written in lowercase and each subsequent word begins with a capital letter, concatenated without any separator characters.

Examples

Example 1

const convertedStr1 = camelCase('camelCase') // returns 'camelCase' const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace' const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText' const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'

Parameters

optional
str: string | object
  • The string that is to be changed to camel case.

Return Type

  • The converted string to camel case.

Add Package

deno add jsr:@es-toolkit/es-toolkit

Import symbol

import { camelCase } from "@es-toolkit/es-toolkit/compat";

---- OR ----

Import directly with a jsr specifier

import { camelCase } from "jsr:@es-toolkit/es-toolkit/compat";

Add Package

npx jsr add @es-toolkit/es-toolkit

Import symbol

import { camelCase } from "@es-toolkit/es-toolkit/compat";

Add Package

yarn dlx jsr add @es-toolkit/es-toolkit

Import symbol

import { camelCase } from "@es-toolkit/es-toolkit/compat";

Add Package

pnpm dlx jsr add @es-toolkit/es-toolkit

Import symbol

import { camelCase } from "@es-toolkit/es-toolkit/compat";

Add Package

bunx jsr add @es-toolkit/es-toolkit

Import symbol

import { camelCase } from "@es-toolkit/es-toolkit/compat";