Convert a string between camelCase, PascalCase, Title Case, snake_case and more.

npm install change-case
12 downloads in the last day
293 downloads in the last week
1 176 downloads in the last month


Quickly convert strings between camelCase, PascalCase, Title Case, snake_case, lowercase, UPPERCASE, CONSTANT_CASE and more.


npm install change-case --save


var changeCase = require('change-case');
//=> { isUpperCase: [Function], ... }

isUpperCase changeCase.isUpperCase(string)

Return a boolean indicating the string is upper cased.

changeCase.isUpperCase('test string');
//=> false

isLowerCase changeCase.isLowerCase(string)

Return a boolean indicating the string is lower cased.

changeCase.isLowerCase('test string');
//=> true

upperCase changeCase.upperCase(string)

Return an upper cased string.

changeCase.upperCase('test string');

lowerCase changeCase.lowerCase(string)

Return a lower cased string.

changeCase.lowerCase('TEST STRING');
//=> "test string"

titleCase changeCase.titleCase(string)

Return a space separated string with the first character of every word upper cased.

changeCase.titleCase('a simple test');
//=> "A Simple Test"

sentenceCase changeCase.sentenceCase(string)

Return a lower cased, space separated string.

//=> "test string"

camelCase changeCase.camelCase(string)

Return a string with the separators denoted by having the next letter capitalized.

changeCase.camelCase('test string');
//=> "testString"

pascalCase changeCase.pascalCase(string)

Return a string denoted in the same fashion as camelCase, but with the first letter also capitalized.

changeCase.pascalCase('test string');
//=> "TestString"

snakeCase changeCase.snakeCase(string)

Return a lower cased, space separated string.

changeCase.snakeCase('test string');
--> "test_string"

paramCase changeCase.paramCase(string)

Return a lower cased, dash separated string.

changeCase.paramCase('test string');
//=> "test-case"

dotCase changeCase.dotCase(string)

Return a lower cased, period separated string.

changeCase.dotCase('test string');
//=> "test.string"

pathCase changeCase.pathCase(string)

Return a lower cased, slash separated string.

changeCase.pathCase('test string');
//=> "test/string"

constantCase changeCase.constantCase(string)

Return an upper cased, underscore separated string.

changeCase.constantCase('test string');

swapCase changeCase.swapCase(string)

Return a string with lower case characters upper cased and upper case character lower cased.

changeCase.swapCase('Test String');
//=> "tEST sTRING"



npm loves you