change-case-all
All change-case methods bundled in a single module
Last updated a year ago by btxtiger .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install change-case-all 
SYNC missed versions from official npm registry.

change-case-all

CI npm npm npm

Change case functions for all cases in TypeScript and JavaScript. Combined version of all change-case methods, so you do not need to install them separately. ESM and CJS bundles are included, also backwards compatible with change-case@4.1.0.

change-case-all@2.0.0 introduces a Case helper class, which can be used to access all methods.

Usage

npm install --save change-case-all

Browser / ESM

import { Case } from 'change-case-all';
const camel = Case.camel('test string'); // testString
const upper = Case.upper('test string'); // TEST STRING


import { camelCase, upperCase, ... } from 'change-case-all';
const camel = camelCase('test string'); // testString
const upper = upperCase('test string'); // TEST STRING

Node.js

const { Case } = require('change-case-all');
const camel = Case.camel('foo-bar'); // fooBar
const snake = Case.snake('fooBar'); // foo_bar

const { camelCase, snakeCase } = require('change-case-all');
const camel = camelCase('foo-bar'); // fooBar
const snake = snakeCase('fooBar'); // foo_bar

Changelog

2.1.0

  • Bundle dependencies in module to support Node.js

2.0.0

  • Updated dependencies to change-case@5.2.0
  • ParamCase → now KebabCase
  • HeaderCase → now TrainCase
  • Create mjs and cjs bundles
  • Introduce Case helper class: e.g. Case.camel('test string'); // testString
  • TitleCase@4.1.0 failing in tests, thus kept at 3.0.3

Links

Methods

Class based usage

import { Case } from 'change-case-all';

const str = 'test string';

camel       = Case.camel(str);               // testString
capital     = Case.capital(str);             // Test String
constant    = Case.constant(str);            // TEST_STRING
dot         = Case.dot(str);                 // test.string
no          = Case.no(str);                  // test string
pascal      = Case.pascal(str);              // TestString
path        = Case.path(str);                // test/string
sentence    = Case.sentence(str);            // Test string
snake       = Case.snake(str);               // test_string
train       = Case.train(str);               // Test-String
kebap       = Case.kebap(str);               // test-string
sponge      = Case.sponge(str);              // TeSt StRiNg
swapCase    = Case.swap(str);                // TEST STRING
title       = Case.title(str);               // Test String
uppper      = Case.upper(str);               // TEST STRING
localeUpper = Case.localeUpper(str, 'en');   // TEST STRING
lower       = Case.lower(str);               // test string
localeLower = Case.localeLower(str, 'en');   // test string
lowerFirst  = Case.lowerFirst(str);          // test string
upperFirst  = Case.upperFirst(str);          // Test string
isUpper     = Case.isUpper(str);             // false
isLower     = Case.isLower(str);             // true

Function based usage

import { camelCase, upperCase, ... } from 'change-case-all';

const str = 'test string';

camel       = camelCase(str);               // testString
capital     = capitalCase(str);             // Test String
constant    = constantCase(str);            // TEST_STRING
dot         = dotCase(str);                 // test.string
no          = noCase(str);                  // test string
pascal      = pascalCase(str);              // TestString
path        = pathCase(str);                // test/string
sentence    = sentenceCase(str);            // Test string
snake       = snakeCase(str);               // test_string
train       = trainCase(str);               // Test-String
kebap       = kebapCase(str);               // test-string
sponge      = spongeCase(str);              // TeSt StRiNg
swapCase    = swapCase(str);                // TEST STRING
title       = titleCase(str);               // Test String
uppper      = upperCase(str);               // TEST STRING
localeUpper = localeUpperCase(str, 'en');   // TEST STRING
lower       = lowerCase(str);               // test string
localeLower = localeLowerCase(str, 'en');   // test string
lowerFirst  = lowerCaseFirst(str);          // test string
upperFirst  = upperCaseFirst(str);          // Test string
isUpper     = isUpperCase(str);             // false
isLower     = isLowerCase(str);             // true

Current Tags

  • 2.1.0                                ...           latest (a year ago)

18 Versions

  • 2.1.0                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           4 years ago
  • 1.0.13                                ...           4 years ago
  • 1.0.12                                ...           5 years ago
  • 1.0.11                                ...           5 years ago
  • 1.0.10                                ...           5 years ago
  • 1.0.9                                ...           5 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.7                                ...           5 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (5)

© 2010 - cnpmjs.org x YWFE | Home | YWFE