1.0.2 • Published 5 years ago

text-as-i-want v1.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Text As I Want

This package convert strings and properties/keys of the Object between camelCase, PascalCase, Capitalize Each Word, snake_case and more.

Installation

npm install text-as-i-want --save

Usage

var textAsIWant = require('text-as-i-want');

//For camelCase (Strings)
textAsIwant.stringToCamelCase("your string"); // It will return the converted string in camelCase

//For camelCase (Object Keys)
textAsIwant.objectToCamelCase(yourObject); // It will return the object with converted properties in camelCase


//For snake_case (Strings)
textAsIwant.stringToSnakeCase("your string"); // It will return the converted string in snake_case

//For snake_case (Object Keys)
textAsIwant.objectToSnakeCase(yourObject); // It will return the object with converted properties in snake_case


//For kebab-case (Strings)
textAsIwant.stringToKebabCase("your string"); // It will return the converted string in kebab-case

//For kebab-case (Object Keys)
textAsIwant.objectToKebabCase(yourObject); // It will return the object with converted properties in kebab-case


//For PascalCase (Strings)
textAsIwant.stringToPascalCase("your string"); // It will return the converted string in PascalCase

//For PascalCase (Object Keys)
textAsIwant.objectToPascalCase(yourObject); // It will return the object with converted properties in PascalCase

//For Capitalizing Each Word in a Sentence

textAsIwant.stringToCapitalizeEachWord("your sentence");

//For Capitalizing the sentence

textAsIwant.stringToCapitalizeSentence("your sentence");