3.1.0 • Published 1 year ago

@stein197/caser v3.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

String case converter and parser

npm.io npm.io

This tiny package provides means for converting strings between different cases - such as converting camelCase to snake_case and so on.

Installation

npm install @stein197/caser

Usage:

import * as caser from "@stein197/caser";

caser.covert("HTMLElement", "header", true); // "HTML-Element"
caser.convert("CONSTANT_VALUE", {separator: "-", leadCharCase: "upper", firstCharCase: "upper", case: "lower"}, false); // "Constant-Value"
caser.split("camelCase"); // ["camel", "Case"]

Predefined cases

  • flat flatcase
  • camel camelCase
  • header Header-Case
  • kebab kebab-case
  • pascal PascalCase
  • snake snake_case
  • upper UPPER_CASE
  • train TRAIN-CASE

    For detailed documentation, refer to the source code docblocks

NPM scripts

  • clean cleans working directory from compiled files
  • build compiles source code
  • test runs unit tests
3.1.0

1 year ago

3.0.0

1 year ago

2.0.0

2 years ago

1.0.0

3 years ago