toolpage / js-case-converter

The JS Case Converter collection helps changing the cases of existing texts.

Home Page:https://en.toolpage.org/cat/case-converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS Case Converter

The JS Case Converter collection helps changing the cases of existing texts.

Usage

Import caseconverter.js into your JS project or HTML page and use the functions of the CaseConverter object:

<!DOCTYPE html>
<html>
  <head>
    <script src="caseconverter.js"></script>
  </head>
  <body>
    <script>
      var input = "The quick brown fox jumps over the lazy dog";
      CaseConverter.convertToUpperCase(input); 	// THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
      CaseConverter.convertToLowerCase(input); 	// the quick brown fox jumps over the lazy dog
      CaseConverter.convertToStartCase(input); 	// The Quick Brown Fox Jumps Over The Lazy Dog
      CaseConverter.convertToCamelCase(input); 	// TheQuickBrownFoxJumpsOverTheLazyDog
      CaseConverter.convertToSnakeCase(input); 	// The_Quick_Brown_Fox_Jumps_Over_The_Lazy_Dog
      CaseConverter.convertToKebabCase(input); 	// the-quick-brown-fox-jumps-over-the-lazy-dog
      CaseConverter.convertToStudlyCaps(input);	// thE qUIck BRoWN foX jUMPs oVeR tHe lAZY doG
      CaseConverter.invertCase(input); 		// tHE QUICK BROWN FOX JUMPS OVER THE LAZY DOG    
    </script>
  </body>
</html>

Minify

If you want to use a minified version of caseconverter.js, you have to minify it before usage. One way is to run the minifier tool via npm.

Installing:

[sudo] npm install [-g] minifier

Minifying:

minify --output caseconverter.min.js caseconverter.js

Online Resources

Get more information and online tools for this implementation on https://en.toolpage.org/cat/case-converter

About

The JS Case Converter collection helps changing the cases of existing texts.

https://en.toolpage.org/cat/case-converter

License:GNU General Public License v3.0


Languages

Language:JavaScript 94.2%Language:HTML 5.8%