JSPM

case-modifier

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q35654F
  • License MIT

Convert string to target CaseType, like: camelCase, snakeCase, properCase, constantCase...

Package Exports

  • case-modifier

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (case-modifier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

case-modifier License Version

Convert string to target CaseType, like: camelCase, snakeCase, properCase, constantCase

Install

npm i case-modifier

Usage

import * as CaseModifier from 'case-modifier'

// type: camelCase
CaseModifier.CASE_CAMEL

CaseModifier.camelCase('we-will-rock-the-word') // weWillRockTheWord

// type: snakeCase
CaseModifier.CASE_SNAKE
CaseModifier.snakeCase('we-will-rock-the-word') // we_will_rock_the_word

// type: kebabCase
CaseModifier.CASE_KEBAB
CaseModifier.CASE_DASH
CaseModifier.kebabCase('WeWillRockTheWord') // we-will-rock-the-word

// type: properCase
CaseModifier.CASE_PROPER
CaseModifier.CASE_PASCAL
CaseModifier.properCase('we-will-rock-the-word') // WeWillRockTheWord

// type: constantCase
CaseModifier.CASE_CONSTANT
CaseModifier.constantCase('WeWillRockTheWord') // WE_WILL_ROCK_THE_WORD


// covert(str, caseType)
CaseModifier.convert('we-will-rock-the-word') // weWillRockTheWord
CaseModifier.convert('we-will-rock-the-word', CaseModifier.CASE_PROPER) // WeWillRockTheWord


// if not support, just return source string
CaseModifier.convert('We will rock the word') // We will rock the word