text-case

Convert text between `camelCase`, `PascalCase`, `Capital Case`, `Header-Case`, `Title Case`, `path/case`, `snake_case`, `param-case`, `dot.case`, `CONSTANT_CASE`, `lower case`, `lOWER CASE FIRST`, `UPPER CASE`, `Upper case first` and other

Usage no npm install needed!

<script type="module">
  import textCase from 'https://cdn.skypack.dev/text-case';
</script>

README

Change Case

NPM version NPM downloads Bundle size

Convert text between camelCase, PascalCase, Capital Case, Header-Case, Title Case, path/case, snake_case, param-case, dot.case, no case, CONSTANT_CASE, lower case, lOWER CASE FIRST, UPPER CASE, Upper case first, sWaP cAsE -> SwAp CaSe, Sentence Case, isLowerCase, isUpperCase, and other

Installation

npm install text-case --save

Usage

import {
  camelCase, // `camelCase`
  pascalCase, // `PascalCase`
  capitalCase, // `Capital Case`
  headerCase, // `Header-Case`
  titleCase, // `Title Case`
  pathCase, // `path/case`
  snakeCase, // `snake_case`
  paramCase, // `param-case`
  dotCase, // `dot.case`
  noCase, // `no case`
  constantCase, // `CONSTANT_CASE`
  lowerCase, // `lower case`
  lowerCaseFirst, // `lOWER CASE FIRST`
  upperCase, // `UPPER CASE`
  upperCaseFirst, // `Upper case first`
  swapCase, // `sWaP cAsE` -> `SwAp CaSe`
  sentenceCase,
  isLowerCase,
  isUpperCase,
} from "text-case";

Methods can also be installed independently. All functions also accept options as the second argument.

License

MIT