npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

text-tweak

v0.0.5

Published

text-tweak is your go-to toolkit for hassle-free string casing formatting in JavaScript/TypeScript. With a suite of intuitive functions, you can effortlessly convert text between various casing styles, whether it's lowercase, UPPERCASE, Title Case, camelC

Downloads

336

Readme

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:

npm 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:

  1. Import the necessary functions from the text-tweak package:
import {
  toLowerCase,
  toUpperCase,
  toTitleCase,
  toSentenceCase,
  toCamelCase,
  toSnakeCase,
  toKebabCase,
  toPascalCase,
  toConstantCase,
  toDotCase,
  toPathCase,
  toAlternatingCase,
  toInvertedCase,
  toSpongeCase,
  toReverseCase,
  toSmallCaps
} from 'text-tweak';

toLowerCase()

Converts a string to lowercase.

const text = 'Hello World';
const lowerCaseText = toLowerCase(text);
console.log(lowerCaseText); // Output: 'hello world'

toUpperCase()

Converts a string to uppercase.

const text = 'Hello World';
const upperCaseText = toUpperCase(text);
console.log(upperCaseText); // Output: 'HELLO WORLD'

toTitleCase()

Converts a string to camel case.

const text = 'hello world';
const camelCaseText = toCamelCase(text);
console.log(camelCaseText); // Output: 'Hello World'

toSentenceCase()

Converts a string to camel case.

const text = 'hello world';
const camelCaseText = toCamelCase(text);
console.log(camelCaseText); // Output: 'Hello world'

toCamelCase()

Converts a string to camel case.

const text = 'hello world';
const camelCaseText = toCamelCase(text);
console.log(camelCaseText); // Output: 'helloWorld'

toKebabCase()

Converts a string to kebab case.

const text = 'Hello World';
const kebabCaseText = toKebabCase(text);
console.log(kebabCaseText); // Output: 'hello-world'

toPascalCase()

Converts a string to Pascal case.

const text = 'hello world';
const pascalCaseText = toPascalCase(text);
console.log(pascalCaseText); // Output: 'HelloWorld'

toConstantCase()

Converts a string to constant case.

const text = 'Hello World';
const constantCaseText = toConstantCase(text);
console.log(constantCaseText); // Output: 'HELLO_WORLD'

toDotCase()

Converts a string to dot case.

const text = 'Hello World';
const dotCaseText = toDotCase(text);
console.log(dotCaseText); // Output: 'hello.world'

toPathCase()

Converts a string to path case.

const text = 'Hello World';
const pathCaseText = toPathCase(text);
console.log(pathCaseText); // Output: 'hello/world'

toAlternatingCase()

Converts a string to alternating case.

const text = 'Hello World';
const alternatingCaseText = toAlternatingCase(text);
console.log(alternatingCaseText); // Output: 'HeLlO wOrLd'

toInvertedCase()

Converts a string to inverted case.

const text = 'Hello World';
const invertedCaseText = toInvertedCase(text);
console.log(invertedCaseText); // Output: 'hELLO wORLD'

toSpongeCase()

Converts a string to sponge case.

const text = 'Hello World';
const spongeCaseText = toSpongeCase(text);
console.log(spongeCaseText); // Output: 'hElLo wOrLd'

toReverseCase()

Converts a string to reverse case.

const text = 'Hello World';
const reverseCaseText = toReverseCase(text);
console.log(reverseCaseText); // Output: 'hELLO wORLD'

toSmallCaps()

Converts a string to small caps.

const text = 'Hello World';
const smallCapsText = toSmallCaps(text);
console.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