Installations
npm install text-tweak
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
16.20.2
NPM Version
8.19.4
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
ashishcumar
Download Statistics
Total Downloads
565
Last Day
1
Last Week
2
Last Month
12
Last Year
565
GitHub Statistics
28 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
4.30 kB
Minified
883.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.0.6
Package Id
text-tweak@0.0.6
Unpacked Size
22.54 kB
Size
4.26 kB
File Count
7
NPM Version
8.19.4
Node Version
16.20.2
Publised On
03 Jun 2024
Total Downloads
Cumulative downloads
Total Downloads
565
Last day
0%
1
Compared to previous day
Last week
0%
2
Compared to previous week
Last month
-67.6%
12
Compared to previous month
Last year
0%
565
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
3
text-tweak
text-tweak is a lightweight JavaScript/TypeScript package for effortless string casing formatting. With text-tweak, you can easily convert text between various casing styles such as lowercase, UPPERCASE, Title Case, camelCase, snake_case, kebab-case, PascalCase, and more.
Installation
To install text-tweak, simply use npm:
1npm install text-tweak
Key Features
- Convert text to lowercase, UPPERCASE, Title Case, sentence case, and more.
- Transform text into camelCase, snake_case, kebab-case, PascalCase, and more.
- Create engaging and consistent text formatting effortlessly.
- Supports a variety of common and custom casing styles.
Why Choose text-tweak
- Easy-to-use functions for quick and efficient string casing transformations.
- Versatile package suitable for a wide range of projects.
- Lightweight package with minimal overhead.
- Well-tested and reliable functions to ensure consistent results.
How to Use
To use the functions provided by the text-tweak
package, follow these steps:
- Import the necessary functions from the
text-tweak
package:
1import { 2 toLowerCase, 3 toUpperCase, 4 toTitleCase, 5 toSentenceCase, 6 toCamelCase, 7 toSnakeCase, 8 toKebabCase, 9 toPascalCase, 10 toConstantCase, 11 toDotCase, 12 toPathCase, 13 toAlternatingCase, 14 toInvertedCase, 15 toSpongeCase, 16 toReverseCase, 17 toSmallCaps 18} from 'text-tweak'; 19
toLowerCase()
Converts a string to lowercase.
1const text = 'Hello World'; 2const lowerCaseText = toLowerCase(text); 3console.log(lowerCaseText); // Output: 'hello world'
toUpperCase()
Converts a string to uppercase.
1const text = 'Hello World'; 2const upperCaseText = toUpperCase(text); 3console.log(upperCaseText); // Output: 'HELLO WORLD'
toTitleCase()
Converts a string to camel case.
1const text = 'hello world'; 2const camelCaseText = toCamelCase(text); 3console.log(camelCaseText); // Output: 'Hello World'
toSentenceCase()
Converts a string to camel case.
1const text = 'hello world'; 2const camelCaseText = toCamelCase(text); 3console.log(camelCaseText); // Output: 'Hello world'
toCamelCase()
Converts a string to camel case.
1const text = 'hello world'; 2const camelCaseText = toCamelCase(text); 3console.log(camelCaseText); // Output: 'helloWorld'
toKebabCase()
Converts a string to kebab case.
1const text = 'Hello World'; 2const kebabCaseText = toKebabCase(text); 3console.log(kebabCaseText); // Output: 'hello-world'
toPascalCase()
Converts a string to Pascal case.
1const text = 'hello world'; 2const pascalCaseText = toPascalCase(text); 3console.log(pascalCaseText); // Output: 'HelloWorld'
toConstantCase()
Converts a string to constant case.
1const text = 'Hello World'; 2const constantCaseText = toConstantCase(text); 3console.log(constantCaseText); // Output: 'HELLO_WORLD'
toDotCase()
Converts a string to dot case.
1const text = 'Hello World'; 2const dotCaseText = toDotCase(text); 3console.log(dotCaseText); // Output: 'hello.world'
toPathCase()
Converts a string to path case.
1const text = 'Hello World'; 2const pathCaseText = toPathCase(text); 3console.log(pathCaseText); // Output: 'hello/world'
toAlternatingCase()
Converts a string to alternating case.
1const text = 'Hello World'; 2const alternatingCaseText = toAlternatingCase(text); 3console.log(alternatingCaseText); // Output: 'HeLlO wOrLd'
toInvertedCase()
Converts a string to inverted case.
1const text = 'Hello World'; 2const invertedCaseText = toInvertedCase(text); 3console.log(invertedCaseText); // Output: 'hELLO wORLD'
toSpongeCase()
Converts a string to sponge case.
1const text = 'Hello World'; 2const spongeCaseText = toSpongeCase(text); 3console.log(spongeCaseText); // Output: 'hElLo wOrLd'
toReverseCase()
Converts a string to reverse case.
1const text = 'Hello World'; 2const reverseCaseText = toReverseCase(text); 3console.log(reverseCaseText); // Output: 'hELLO wORLD'
toSmallCaps()
Converts a string to small caps.
1const text = 'Hello World'; 2const smallCapsText = toSmallCaps(text); 3console.log(smallCapsText); // Output: 'ʜᴇʟʟᴏ ᴡᴏʀʟᴅ'
Check out these other fantastic packages developed by Me:
-
Debounce Throttling 🕒 - Smooth out your application's performance by managing function calls with debouncing and throttling techniques.
-
LocalSafe 🔒 - Securely store sensitive data locally in the user's browser with encryption and other protective measures.
-
Online Status JS 🌐 - Keep track of your user's online status and enhance your application's real-time capabilities.
🌟 Made with ❤️ by Ashish
No vulnerabilities found.
No security vulnerabilities found.