text-case
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

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

Package Sidebar

Install

npm i text-case

Weekly Downloads

2,366

Version

1.0.9

License

MIT

Unpacked Size

11 kB

Total Files

7

Last publish

Collaborators

  • dimetrix